From 9bc81a77589ff54b720f111b711bc30fcb61617d Mon Sep 17 00:00:00 2001 From: Max Pfeiffer Date: Fri, 6 Oct 2023 18:21:10 +0200 Subject: [PATCH 01/11] Added Python v3.12 support, dropped v3.9 --- .env-example | 2 +- .github/workflows/pipeline.yml | 14 +++++++------- .gitignore | 1 + README.md | 2 +- poetry.lock | 29 +++-------------------------- pyproject.toml | 6 +++--- 6 files changed, 16 insertions(+), 38 deletions(-) diff --git a/.env-example b/.env-example index 4bcfcf1..bbdc052 100644 --- a/.env-example +++ b/.env-example @@ -1,4 +1,4 @@ USE_LOCAL_CACHE_STORAGE_BACKEND=1 -PYTHON_VERSION=3.9.18 +PYTHON_VERSION=3.12.0 OS_VARIANT=slim-bookworm POETRY_VERSION=1.6.1 diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 60392e8..db77f0f 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -11,7 +11,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: 3.11 - name: Install Poetry uses: snok/install-poetry@v1 with: @@ -39,7 +39,7 @@ jobs: strategy: fail-fast: false matrix: - python_version: ["3.9.18", "3.10.13", "3.11.5"] + python_version: ["3.10.13", "3.11.6", "3.12.0"] os_variant: ["bookworm", "slim-bookworm"] poetry_version: ["1.4.2", "1.5.1", "1.6.1"] steps: @@ -50,7 +50,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: 3.11 - name: Install Poetry uses: snok/install-poetry@v1 with: @@ -86,7 +86,7 @@ jobs: strategy: fail-fast: false matrix: - python_version: ["3.9.18", "3.10.13", "3.11.5"] + python_version: ["3.10.13", "3.11.6", "3.12.0"] os_variant: ["bookworm", "slim-bookworm"] poetry_version: ["1.4.2", "1.5.1", "1.6.1"] steps: @@ -97,7 +97,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: 3.11 - name: Install Poetry uses: snok/install-poetry@v1 with: @@ -136,7 +136,7 @@ jobs: strategy: fail-fast: false matrix: - python_version: ["3.9.18", "3.10.13", "3.11.5"] + python_version: ["3.10.13", "3.11.6", "3.12.0"] os_variant: ["bookworm", "slim-bookworm"] poetry_version: ["1.4.2", "1.5.1", "1.6.1"] steps: @@ -149,7 +149,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: 3.11 - name: Install Poetry uses: snok/install-poetry@v1 with: diff --git a/.gitignore b/.gitignore index e49a264..82a9c2e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ .idea .vscode .pytest_cache +.python-version __pycache__ diff --git a/README.md b/README.md index 381e657..2f102d6 100644 --- a/README.md +++ b/README.md @@ -27,9 +27,9 @@ This multiarch image supports AMD64 and ARM64 architectures. * v1.6.1 **Python versions:** -* v3.9 * v3.10 * v3.11 +* v3.12 **Operating system:** * [Debian Bookworm v12.1](https://www.debian.org/releases/bookworm/) diff --git a/poetry.lock b/poetry.lock index a5ccf49..d196da0 100644 --- a/poetry.lock +++ b/poetry.lock @@ -22,9 +22,6 @@ files = [ {file = "astroid-3.0.0.tar.gz", hash = "sha256:1defdbca052635dd29657ea674edfc45e4b5be9cd53630c5b084fcfed94344a8"}, ] -[package.dependencies] -typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.11\""} - [[package]] name = "bcrypt" version = "4.0.1" @@ -96,8 +93,6 @@ mypy-extensions = ">=0.4.3" packaging = ">=22.0" pathspec = ">=0.9.0" platformdirs = ">=2" -tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typing-extensions = {version = ">=4.0.1", markers = "python_version < \"3.11\""} [package.extras] colorama = ["colorama (>=0.4.3)"] @@ -392,20 +387,6 @@ files = [ [package.dependencies] regex = ">=2019.4.14" -[[package]] -name = "exceptiongroup" -version = "1.1.3" -description = "Backport of PEP 654 (exception groups)" -optional = false -python-versions = ">=3.7" -files = [ - {file = "exceptiongroup-1.1.3-py3-none-any.whl", hash = "sha256:343280667a4585d195ca1cf9cef84a4e178c4b6cf2274caef9859782b567d5e3"}, - {file = "exceptiongroup-1.1.3.tar.gz", hash = "sha256:097acd85d473d75af5bb98e41b61ff7fe35efe6675e4f9370ec6ec5126d160e9"}, -] - -[package.extras] -test = ["pytest (>=6)"] - [[package]] name = "filelock" version = "3.12.4" @@ -761,13 +742,11 @@ files = [ [package.dependencies] astroid = ">=3.0.0,<=3.1.0-dev0" colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} -dill = {version = ">=0.2", markers = "python_version < \"3.11\""} +dill = {version = ">=0.3.6", markers = "python_version >= \"3.11\""} isort = ">=4.2.5,<6" mccabe = ">=0.6,<0.8" platformdirs = ">=2.2.0" -tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} tomlkit = ">=0.10.1" -typing-extensions = {version = ">=3.10.0", markers = "python_version < \"3.10\""} [package.extras] spelling = ["pyenchant (>=3.2,<4.0)"] @@ -786,11 +765,9 @@ files = [ [package.dependencies] colorama = {version = "*", markers = "sys_platform == \"win32\""} -exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} iniconfig = "*" packaging = "*" pluggy = ">=0.12,<2.0" -tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} [package.extras] testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] @@ -1337,5 +1314,5 @@ files = [ [metadata] lock-version = "2.0" -python-versions = "3.9.*" -content-hash = "39a6688e98cfc36daf7e21bf1bbc29828a52ef0b6343515c88676c93285f092a" +python-versions = "3.11.*" +content-hash = "76a9b481793badb4369ae2a4f9d8fbd2dfd38e5191c6302a27c5fab3291de7ec" diff --git a/pyproject.toml b/pyproject.toml index 4db4153..a9a8174 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,12 @@ [tool.poetry] name = "python-poetry" -version = "1.2.0" +version = "1.7.0" description = "A Python Docker image with Poetry installed and ready to use." authors = ["Max Pfeiffer "] license = "MIT" [tool.poetry.dependencies] -python = "3.9.*" +python = "3.11.*" click = "8.1.7" python-on-whales = "0.65.0" @@ -33,7 +33,7 @@ testpaths = [ # https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#configuration-via-a-file [tool.black] line-length = 80 -target-version = ["py39"] +target-version = ["py311"] [tool.pylint.main] errors-only = true From 4ac65d0b90608f0456e4a8f5b120dbe649abdb82 Mon Sep 17 00:00:00 2001 From: Max Pfeiffer Date: Fri, 6 Oct 2023 19:00:09 +0200 Subject: [PATCH 02/11] Updated Codecov action for workflow --- .github/workflows/pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index db77f0f..bbbfa99 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -75,7 +75,7 @@ jobs: source .venv/bin/activate pytest tests/build_image --cov - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} @@ -122,7 +122,7 @@ jobs: source .venv/bin/activate pytest tests/publish_image --cov - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} From f82ae69fed573d3ccba7fe25bc466f658c9b52e5 Mon Sep 17 00:00:00 2001 From: Max Pfeiffer Date: Fri, 6 Oct 2023 19:07:49 +0200 Subject: [PATCH 03/11] Fixing failing Codecov uploads in pipeline --- .github/workflows/pipeline.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index bbbfa99..65c3848 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -75,9 +75,9 @@ jobs: source .venv/bin/activate pytest tests/build_image --cov - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v3 with: - fail_ci_if_error: true + fail_ci_if_error: false token: ${{ secrets.CODECOV_TOKEN }} run-publish-image-tests: @@ -122,9 +122,9 @@ jobs: source .venv/bin/activate pytest tests/publish_image --cov - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v3 with: - fail_ci_if_error: true + fail_ci_if_error: false token: ${{ secrets.CODECOV_TOKEN }} publish-all-images: From 73429c0c97797296726b6901f7579bc400271fc7 Mon Sep 17 00:00:00 2001 From: Max Pfeiffer Date: Fri, 6 Oct 2023 19:46:44 +0200 Subject: [PATCH 04/11] Added a separate stage to upload coverage reports --- .github/workflows/pipeline.yml | 41 +++++++++++++++++++++++++--------- .gitignore | 1 + 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 65c3848..d1a23fe 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -73,12 +73,14 @@ jobs: POETRY_VERSION: ${{ matrix.poetry_version }} run: | source .venv/bin/activate - pytest tests/build_image --cov - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + pytest tests/build_image --cov --cov-report=xml:build_image_coverage_report.xml + - name: Upload coverage report + uses: actions/upload-artifact@v3 with: - fail_ci_if_error: false - token: ${{ secrets.CODECOV_TOKEN }} + name: build-image-coverage-report ${{ matrix.python_version }}-${{ matrix.os_variant }}-${{ matrix.poetry_version }} + path: /build_image_coverage_report.xml + if-no-files-found: error + retention-days: 1 run-publish-image-tests: needs: code-quality @@ -120,17 +122,36 @@ jobs: POETRY_VERSION: ${{ matrix.poetry_version }} run: | source .venv/bin/activate - pytest tests/publish_image --cov + pytest tests/publish_image --cov --cov-report=xml:publish_image_coverage_report.xml + - name: Upload coverage report + uses: actions/upload-artifact@v3 + with: + name: publish-image-coverage-report ${{ matrix.python_version }}-${{ matrix.os_variant }}-${{ matrix.poetry_version }} + path: /publish_image_coverage_report.xml + if-no-files-found: error + retention-days: 1 + + upload-test-coverage-report: + needs: + - run-build-image-tests + - run-publish-image-tests + runs-on: ubuntu-20.04 + steps: + - name: Download coverage reports + uses: actions/download-artifact@v3 + with: + path: / - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: - fail_ci_if_error: false + files: ./build_image_coverage_report.xml,./publish_image_coverage_report.xml + fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} - + + publish-all-images: needs: - - run-build-image-tests - - run-publish-image-tests + - upload-test-coverage-report if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-20.04 strategy: diff --git a/.gitignore b/.gitignore index 82a9c2e..1ccbaa6 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ .vscode .pytest_cache .python-version +.coverage __pycache__ From ddd075ab0e0f5f43a8cb27e429632fc6f8ba57d0 Mon Sep 17 00:00:00 2001 From: Max Pfeiffer Date: Fri, 6 Oct 2023 19:59:15 +0200 Subject: [PATCH 05/11] Checking for coverage file --- .github/workflows/pipeline.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index d1a23fe..50be7d4 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -123,6 +123,8 @@ jobs: run: | source .venv/bin/activate pytest tests/publish_image --cov --cov-report=xml:publish_image_coverage_report.xml + ls -sal + pwd - name: Upload coverage report uses: actions/upload-artifact@v3 with: From 4098141caac3708538f7c2ce0bf26582abbb3360 Mon Sep 17 00:00:00 2001 From: Max Pfeiffer Date: Fri, 6 Oct 2023 22:42:41 +0200 Subject: [PATCH 06/11] Chaning path for artifact upload --- .github/workflows/pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 50be7d4..c14690d 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -78,7 +78,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: build-image-coverage-report ${{ matrix.python_version }}-${{ matrix.os_variant }}-${{ matrix.poetry_version }} - path: /build_image_coverage_report.xml + path: build_image_coverage_report.xml if-no-files-found: error retention-days: 1 @@ -129,7 +129,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: publish-image-coverage-report ${{ matrix.python_version }}-${{ matrix.os_variant }}-${{ matrix.poetry_version }} - path: /publish_image_coverage_report.xml + path: publish_image_coverage_report.xml if-no-files-found: error retention-days: 1 From 32fa74fbc8385e0a2504415cbde529f246ef7950 Mon Sep 17 00:00:00 2001 From: Max Pfeiffer Date: Fri, 6 Oct 2023 23:21:09 +0200 Subject: [PATCH 07/11] Debugging artifact download --- .github/workflows/pipeline.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index c14690d..e817f51 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -139,10 +139,18 @@ jobs: - run-publish-image-tests runs-on: ubuntu-20.04 steps: + - name: Check file system + run: | + pwd + ls -sal - name: Download coverage reports uses: actions/download-artifact@v3 with: - path: / + name: publish-image-coverage-report + - name: Check file system after upload + run: | + pwd + ls -sal - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: From e5867ba05e1de198d60cb5b8456c64ba6bf86881 Mon Sep 17 00:00:00 2001 From: Max Pfeiffer Date: Sat, 7 Oct 2023 00:03:35 +0200 Subject: [PATCH 08/11] Exploring runner shell --- .github/workflows/pipeline.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index e817f51..5f5bf60 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -77,7 +77,7 @@ jobs: - name: Upload coverage report uses: actions/upload-artifact@v3 with: - name: build-image-coverage-report ${{ matrix.python_version }}-${{ matrix.os_variant }}-${{ matrix.poetry_version }} + name: build-image-coverage-report-${{ matrix.python_version }}-${{ matrix.os_variant }}-${{ matrix.poetry_version }} path: build_image_coverage_report.xml if-no-files-found: error retention-days: 1 @@ -128,7 +128,7 @@ jobs: - name: Upload coverage report uses: actions/upload-artifact@v3 with: - name: publish-image-coverage-report ${{ matrix.python_version }}-${{ matrix.os_variant }}-${{ matrix.poetry_version }} + name: publish-image-coverage-report-${{ matrix.python_version }}-${{ matrix.os_variant }}-${{ matrix.poetry_version }} path: publish_image_coverage_report.xml if-no-files-found: error retention-days: 1 @@ -143,14 +143,15 @@ jobs: run: | pwd ls -sal + echo "$SHELL" - name: Download coverage reports uses: actions/download-artifact@v3 - with: - name: publish-image-coverage-report - name: Check file system after upload run: | pwd ls -sal + mv **/*.xml . + ls -sal - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: From 2e1463b265ff759776812fa31b7ce78f6619b7b8 Mon Sep 17 00:00:00 2001 From: Max Pfeiffer Date: Sat, 7 Oct 2023 00:36:37 +0200 Subject: [PATCH 09/11] Switching to forced copy for file changes --- .github/workflows/pipeline.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 5f5bf60..3a0dae7 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -144,13 +144,14 @@ jobs: pwd ls -sal echo "$SHELL" + bash --version - name: Download coverage reports uses: actions/download-artifact@v3 - name: Check file system after upload run: | pwd ls -sal - mv **/*.xml . + cp -f **/*.xml . ls -sal - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 From 3a429e716900ce793eeafdc610911d5fdd0a9f39 Mon Sep 17 00:00:00 2001 From: Max Pfeiffer Date: Sat, 7 Oct 2023 08:28:50 +0200 Subject: [PATCH 10/11] Trying to use find for merging the coverage files --- .github/workflows/pipeline.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 3a0dae7..8169189 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -139,19 +139,13 @@ jobs: - run-publish-image-tests runs-on: ubuntu-20.04 steps: - - name: Check file system - run: | - pwd - ls -sal - echo "$SHELL" - bash --version - name: Download coverage reports uses: actions/download-artifact@v3 - name: Check file system after upload run: | pwd ls -sal - cp -f **/*.xml . + find . -name "*.xml" -exec cp {} . \; ls -sal - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 From 6010115de6651e9904868356f3b93bcadf82b16e Mon Sep 17 00:00:00 2001 From: Max Pfeiffer Date: Sat, 7 Oct 2023 09:06:50 +0200 Subject: [PATCH 11/11] Removed clutter and adjusted namings --- .github/workflows/pipeline.yml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 8169189..9155c3b 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -74,7 +74,7 @@ jobs: run: | source .venv/bin/activate pytest tests/build_image --cov --cov-report=xml:build_image_coverage_report.xml - - name: Upload coverage report + - name: Upload coverage report to artifactory uses: actions/upload-artifact@v3 with: name: build-image-coverage-report-${{ matrix.python_version }}-${{ matrix.os_variant }}-${{ matrix.poetry_version }} @@ -123,9 +123,7 @@ jobs: run: | source .venv/bin/activate pytest tests/publish_image --cov --cov-report=xml:publish_image_coverage_report.xml - ls -sal - pwd - - name: Upload coverage report + - name: Upload coverage report to artifactory uses: actions/upload-artifact@v3 with: name: publish-image-coverage-report-${{ matrix.python_version }}-${{ matrix.os_variant }}-${{ matrix.poetry_version }} @@ -133,20 +131,17 @@ jobs: if-no-files-found: error retention-days: 1 - upload-test-coverage-report: + upload-test-coverage-reports: needs: - run-build-image-tests - run-publish-image-tests runs-on: ubuntu-20.04 steps: - - name: Download coverage reports + - name: Download coverage reports from artifactory uses: actions/download-artifact@v3 - - name: Check file system after upload + - name: Compile the relevant reports run: | - pwd - ls -sal find . -name "*.xml" -exec cp {} . \; - ls -sal - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: @@ -157,7 +152,7 @@ jobs: publish-all-images: needs: - - upload-test-coverage-report + - upload-test-coverage-reports if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-20.04 strategy: