From b89f2b44c2fee30b8425179b43e8b1b27f3c672f Mon Sep 17 00:00:00 2001 From: "Mikhail f. Shiryaev" Date: Sun, 23 Jun 2024 16:45:42 +0200 Subject: [PATCH 1/2] Do not spam `Created directory` to stderr on each get_filename4code --- pandocfilters.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pandocfilters.py b/pandocfilters.py index 68569d9..6fd72b1 100755 --- a/pandocfilters.py +++ b/pandocfilters.py @@ -47,11 +47,12 @@ def get_filename4code(module, content, ext=None): else: imagedir = module + "-images" fn = hashlib.sha1(content.encode(sys.getfilesystemencoding())).hexdigest() - try: - os.makedirs(imagedir, exist_ok=True) - sys.stderr.write('Created directory ' + imagedir + '\n') - except OSError: - sys.stderr.write('Could not create directory "' + imagedir + '"\n') + if not os.path.isdir(imagedir): + try: + os.makedirs(imagedir) + sys.stderr.write('Created directory ' + imagedir + '\n') + except OSError: + sys.stderr.write('Could not create directory "' + imagedir + '"\n') if ext: fn += "." + ext return os.path.join(imagedir, fn) From ac4c3861c8b7b6d48bd4f105362c42aafcf6d6c8 Mon Sep 17 00:00:00 2001 From: "Mikhail f. Shiryaev" Date: Mon, 24 Jun 2024 18:38:35 +0200 Subject: [PATCH 2/2] Fix python 3.5 setup in workflow See https://github.com/actions/setup-python/issues/866#issuecomment-2154968862 --- .github/workflows/pythonpackage.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index ee54eef..5d6d7db 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -44,10 +44,13 @@ jobs: # - 2.11.4 # - 2.12 - latest + # The empty env for all python but 3.5 + pip-trusted-host: [""] include: - os: ubuntu-20.04 python-version: 3.5 pandoc-version: latest + pip-trusted-host: "pypi.python.org pypi.org files.pythonhosted.org" - os: ubuntu-20.04 python-version: 3.6 pandoc-version: latest @@ -59,6 +62,8 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + env: + PIP_TRUSTED_HOST: ${{ matrix.pip-trusted-host }} - name: Install examples' dependencies run: sudo apt update && sudo apt install abcm2ps graphviz graphviz-dev texlive-full - name: Install dependencies—pip