Skip to content

Commit

Permalink
Merge pull request #44 from max-pfeiffer/feature/python_version_upgrade
Browse files Browse the repository at this point in the history
Added Python v3.12 support, dropped v3.9
  • Loading branch information
max-pfeiffer committed Oct 7, 2023
2 parents d6bcf61 + 6010115 commit a11ecc8
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 47 deletions.
2 changes: 1 addition & 1 deletion .env-example
Original file line number Diff line number Diff line change
@@ -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
54 changes: 38 additions & 16 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -73,20 +73,22 @@ 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 to artifactory
uses: actions/upload-artifact@v3
with:
fail_ci_if_error: true
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
runs-on: ubuntu-20.04
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:
Expand All @@ -97,7 +99,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:
Expand All @@ -120,23 +122,43 @@ 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 to artifactory
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-reports:
needs:
- run-build-image-tests
- run-publish-image-tests
runs-on: ubuntu-20.04
steps:
- name: Download coverage reports from artifactory
uses: actions/download-artifact@v3
- name: Compile the relevant reports
run: |
find . -name "*.xml" -exec cp {} . \;
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
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-reports
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-20.04
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:
Expand All @@ -149,7 +171,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:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@
.idea
.vscode
.pytest_cache
.python-version
.coverage
__pycache__
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/)
Expand Down
29 changes: 3 additions & 26 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"]
license = "MIT"

[tool.poetry.dependencies]
python = "3.9.*"
python = "3.11.*"
click = "8.1.7"
python-on-whales = "0.65.0"

Expand All @@ -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
Expand Down

0 comments on commit a11ecc8

Please sign in to comment.