Skip to content

Commit

Permalink
Merge pull request #26 from max-pfeiffer/feature/poetry_and_python_ve…
Browse files Browse the repository at this point in the history
…rsion_updates

Feature/poetry and python version updates
  • Loading branch information
max-pfeiffer authored May 24, 2023
2 parents 90df8d4 + 8501c23 commit 53d9b37
Show file tree
Hide file tree
Showing 23 changed files with 639 additions and 295 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
interval: "monthly"
46 changes: 31 additions & 15 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,16 @@ jobs:
with:
version: 1.4.1
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: |
poetry config virtualenvs.in-project true
poetry install --no-root
poetry install --no-interaction --no-root
- name: Run pylint and black
run: |
source .venv/bin/activate
Expand All @@ -33,29 +39,33 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.4.1
virtualenvs-in-project: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: |
poetry config virtualenvs.in-project true
poetry install --no-root
poetry install --no-interaction --no-root
- name: Run all tests with pytest
run: |
source .venv/bin/activate
export DOCKER_BUILDKIT=1
pytest
pytest --cov=./ --cov-report=xml
pytest --cov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
Expand All @@ -69,6 +79,8 @@ jobs:
uses: actions/checkout@v3
- name: Get Git Commit Tag Name
uses: olegtarasov/[email protected]
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Setup Python
uses: actions/setup-python@v4
with:
Expand All @@ -78,12 +90,16 @@ jobs:
with:
version: 1.4.1
virtualenvs-in-project: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: |
poetry config virtualenvs.in-project true
poetry install --no-root
poetry install --no-interaction --no-root
- name: Publish Image to Docker Hub
env:
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
.venv
.env
.idea
.vscode
.pytest_cache
__pycache__
10 changes: 7 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.4.0
hooks:
- id: check-ast
- id: check-merge-conflict
- id: detect-private-key
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: 23.1.0
rev: 23.3.0
hooks:
- id: black
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
entry: .venv/bin/pylint
language: system
types: [python]
args:
- build
- tests

7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@ and [Debian images](https://hub.docker.com/_/debian).

## Docker Image Features
**Poetry versions:**
* v1.2.2
* v1.3.2
* v1.4.1
* v1.4.2
* v1.5.0

**Python versions:**
* v3.7
* v3.8
* v3.9
* v3.10
* v3.11

**Operating system:**
* [Debian Bullseye v10.13](https://www.debian.org/releases/bullseye/)
Expand Down
168 changes: 66 additions & 102 deletions build/constants.py
Original file line number Diff line number Diff line change
@@ -1,67 +1,61 @@
PYTHON_POETRY_IMAGE_NAME: str = "pfeiffermax/python-poetry"
TARGET_ARCHITECTURES: list[str] = [
"poetry1.2.2-python3.7.16-bullseye",
"poetry1.2.2-python3.7.16-slim-bullseye",
"poetry1.2.2-python3.8.16-bullseye",
"poetry1.2.2-python3.8.16-slim-bullseye",
"poetry1.2.2-python3.9.16-bullseye",
"poetry1.2.2-python3.9.16-slim-bullseye",
"poetry1.2.2-python3.10.10-bullseye",
"poetry1.2.2-python3.10.10-slim-bullseye",
"poetry1.3.2-python3.7.16-bullseye",
"poetry1.3.2-python3.7.16-slim-bullseye",
"poetry1.3.2-python3.8.16-bullseye",
"poetry1.3.2-python3.8.16-slim-bullseye",
"poetry1.3.2-python3.9.16-bullseye",
"poetry1.3.2-python3.9.16-slim-bullseye",
"poetry1.3.2-python3.10.10-bullseye",
"poetry1.3.2-python3.10.10-slim-bullseye",
"poetry1.4.1-python3.7.16-bullseye",
"poetry1.4.1-python3.7.16-slim-bullseye",
"poetry1.4.1-python3.8.16-bullseye",
"poetry1.4.1-python3.8.16-slim-bullseye",
"poetry1.4.1-python3.9.16-bullseye",
"poetry1.4.1-python3.9.16-slim-bullseye",
"poetry1.4.1-python3.10.10-bullseye",
"poetry1.4.1-python3.10.10-slim-bullseye",
"poetry1.3.2-python3.10.11-bullseye",
"poetry1.3.2-python3.10.11-slim-bullseye",
"poetry1.3.2-python3.11.3-bullseye",
"poetry1.3.2-python3.11.3-slim-bullseye",
"poetry1.4.2-python3.9.16-bullseye",
"poetry1.4.2-python3.9.16-slim-bullseye",
"poetry1.4.2-python3.10.11-bullseye",
"poetry1.4.2-python3.10.11-slim-bullseye",
"poetry1.4.2-python3.11.3-bullseye",
"poetry1.4.2-python3.11.3-slim-bullseye",
"poetry1.5.0-python3.9.16-bullseye",
"poetry1.5.0-python3.9.16-slim-bullseye",
"poetry1.5.0-python3.10.11-bullseye",
"poetry1.5.0-python3.10.11-slim-bullseye",
"poetry1.5.0-python3.11.3-bullseye",
"poetry1.5.0-python3.11.3-slim-bullseye",
]
BASE_IMAGES: dict = {
TARGET_ARCHITECTURES[
0
]: "python:3.7.16-bullseye@sha256:bf85a74f4ace82f3503c2199aaae10e7a8e370bc7e42fd246c5774891f1fab0b",
]: "python:3.9.16-bullseye@sha256:b8ddeb68904299c09a39aff59d4a713862253b137fdd7ace3a3b7ba0391971b1",
TARGET_ARCHITECTURES[
1
]: "python:3.7.16-slim-bullseye@sha256:aa949f5f10e9b28e1f9561fff73d1a359fa8517d4e543451a714d1a4ecc61c56",
]: "python:3.9.16-slim-bullseye@sha256:9e0b4391fc41bc35c16caef4740736b6b349f6626fd14eba32793ae3c7b01908",
TARGET_ARCHITECTURES[
2
]: "python:3.8.16-bullseye@sha256:3a519327ab069a4e356a8aa279e80b7ef6270e17c5df1493dd0a5b281755e95a",
]: "python:3.10.11-bullseye@sha256:7f8f3cf6668c563e44a2285ce2eca9f8b82f96038449f07183126c95979f7d21",
TARGET_ARCHITECTURES[
3
]: "python:3.8.16-slim-bullseye@sha256:75b74d058401381b056d00f903dff58262d884025f772ed635a68e9699c36b87",
]: "python:3.10.11-slim-bullseye@sha256:12af6fa557c55d85754107e59d0e21530d7a253757e128b3682d138e58712e54",
TARGET_ARCHITECTURES[
4
]: "python:3.9.16-bullseye@sha256:b8ddeb68904299c09a39aff59d4a713862253b137fdd7ace3a3b7ba0391971b1",
]: "python:3.11.3-bullseye@sha256:89cbc1829d74f72436c96302c49218291eb464705c726cc27d71c32fec1d9082",
TARGET_ARCHITECTURES[
5
]: "python:3.9.16-slim-bullseye@sha256:9e0b4391fc41bc35c16caef4740736b6b349f6626fd14eba32793ae3c7b01908",
]: "python:3.11.3-slim-bullseye@sha256:551c9529e77896518ac5693d7e98ee5e12051d625de450ac2a68da1eae15ec87",
TARGET_ARCHITECTURES[
6
]: "python:3.10.10-bullseye@sha256:e37b60978ae806a23be492b0003ea081ff699dcf3375cd2eadce5a5bea48156d",
]: "python:3.9.16-bullseye@sha256:b8ddeb68904299c09a39aff59d4a713862253b137fdd7ace3a3b7ba0391971b1",
TARGET_ARCHITECTURES[
7
]: "python:3.10.10-slim-bullseye@sha256:86c8669ed0c407d423b4235da869e1e5275ea59a8429df3ae62d3c415ad0d171",
]: "python:3.9.16-slim-bullseye@sha256:9e0b4391fc41bc35c16caef4740736b6b349f6626fd14eba32793ae3c7b01908",
TARGET_ARCHITECTURES[
8
]: "python:3.7.16-bullseye@sha256:bf85a74f4ace82f3503c2199aaae10e7a8e370bc7e42fd246c5774891f1fab0b",
]: "python:3.10.11-bullseye@sha256:7f8f3cf6668c563e44a2285ce2eca9f8b82f96038449f07183126c95979f7d21",
TARGET_ARCHITECTURES[
9
]: "python:3.7.16-slim-bullseye@sha256:aa949f5f10e9b28e1f9561fff73d1a359fa8517d4e543451a714d1a4ecc61c56",
]: "python:3.10.11-slim-bullseye@sha256:12af6fa557c55d85754107e59d0e21530d7a253757e128b3682d138e58712e54",
TARGET_ARCHITECTURES[
10
]: "python:3.8.16-bullseye@sha256:3a519327ab069a4e356a8aa279e80b7ef6270e17c5df1493dd0a5b281755e95a",
]: "python:3.11.3-bullseye@sha256:89cbc1829d74f72436c96302c49218291eb464705c726cc27d71c32fec1d9082",
TARGET_ARCHITECTURES[
11
]: "python:3.8.16-slim-bullseye@sha256:75b74d058401381b056d00f903dff58262d884025f772ed635a68e9699c36b87",
]: "python:3.11.3-slim-bullseye@sha256:551c9529e77896518ac5693d7e98ee5e12051d625de450ac2a68da1eae15ec87",
TARGET_ARCHITECTURES[
12
]: "python:3.9.16-bullseye@sha256:b8ddeb68904299c09a39aff59d4a713862253b137fdd7ace3a3b7ba0391971b1",
Expand All @@ -70,84 +64,54 @@
]: "python:3.9.16-slim-bullseye@sha256:9e0b4391fc41bc35c16caef4740736b6b349f6626fd14eba32793ae3c7b01908",
TARGET_ARCHITECTURES[
14
]: "python:3.10.10-bullseye@sha256:e37b60978ae806a23be492b0003ea081ff699dcf3375cd2eadce5a5bea48156d",
]: "python:3.10.11-bullseye@sha256:7f8f3cf6668c563e44a2285ce2eca9f8b82f96038449f07183126c95979f7d21",
TARGET_ARCHITECTURES[
15
]: "python:3.10.10-slim-bullseye@sha256:86c8669ed0c407d423b4235da869e1e5275ea59a8429df3ae62d3c415ad0d171",
]: "python:3.10.11-slim-bullseye@sha256:12af6fa557c55d85754107e59d0e21530d7a253757e128b3682d138e58712e54",
TARGET_ARCHITECTURES[
16
]: "python:3.7.16-bullseye@sha256:bf85a74f4ace82f3503c2199aaae10e7a8e370bc7e42fd246c5774891f1fab0b",
]: "python:3.11.3-bullseye@sha256:89cbc1829d74f72436c96302c49218291eb464705c726cc27d71c32fec1d9082",
TARGET_ARCHITECTURES[
17
]: "python:3.7.16-slim-bullseye@sha256:aa949f5f10e9b28e1f9561fff73d1a359fa8517d4e543451a714d1a4ecc61c56",
TARGET_ARCHITECTURES[
18
]: "python:3.8.16-bullseye@sha256:3a519327ab069a4e356a8aa279e80b7ef6270e17c5df1493dd0a5b281755e95a",
TARGET_ARCHITECTURES[
19
]: "python:3.8.16-slim-bullseye@sha256:75b74d058401381b056d00f903dff58262d884025f772ed635a68e9699c36b87",
TARGET_ARCHITECTURES[
20
]: "python:3.9.16-bullseye@sha256:b8ddeb68904299c09a39aff59d4a713862253b137fdd7ace3a3b7ba0391971b1",
TARGET_ARCHITECTURES[
21
]: "python:3.9.16-slim-bullseye@sha256:9e0b4391fc41bc35c16caef4740736b6b349f6626fd14eba32793ae3c7b01908",
TARGET_ARCHITECTURES[
22
]: "python:3.10.10-bullseye@sha256:e37b60978ae806a23be492b0003ea081ff699dcf3375cd2eadce5a5bea48156d",
TARGET_ARCHITECTURES[
23
]: "python:3.10.10-slim-bullseye@sha256:86c8669ed0c407d423b4235da869e1e5275ea59a8429df3ae62d3c415ad0d171",
]: "python:3.11.3-slim-bullseye@sha256:551c9529e77896518ac5693d7e98ee5e12051d625de450ac2a68da1eae15ec87",
}
PYTHON_VERSIONS: dict = {
TARGET_ARCHITECTURES[0]: "3.7.16",
TARGET_ARCHITECTURES[1]: "3.7.16",
TARGET_ARCHITECTURES[2]: "3.8.16",
TARGET_ARCHITECTURES[3]: "3.8.16",
TARGET_ARCHITECTURES[4]: "3.9.16",
TARGET_ARCHITECTURES[5]: "3.9.16",
TARGET_ARCHITECTURES[6]: "3.10.10",
TARGET_ARCHITECTURES[7]: "3.10.10",
TARGET_ARCHITECTURES[8]: "3.7.16",
TARGET_ARCHITECTURES[9]: "3.7.16",
TARGET_ARCHITECTURES[10]: "3.8.16",
TARGET_ARCHITECTURES[11]: "3.8.16",
TARGET_ARCHITECTURES[0]: "3.9.16",
TARGET_ARCHITECTURES[1]: "3.9.16",
TARGET_ARCHITECTURES[2]: "3.10.11",
TARGET_ARCHITECTURES[3]: "3.10.11",
TARGET_ARCHITECTURES[4]: "3.11.3",
TARGET_ARCHITECTURES[5]: "3.11.3",
TARGET_ARCHITECTURES[6]: "3.9.16",
TARGET_ARCHITECTURES[7]: "3.9.16",
TARGET_ARCHITECTURES[8]: "3.10.11",
TARGET_ARCHITECTURES[9]: "3.10.11",
TARGET_ARCHITECTURES[10]: "3.11.3",
TARGET_ARCHITECTURES[11]: "3.11.3",
TARGET_ARCHITECTURES[12]: "3.9.16",
TARGET_ARCHITECTURES[13]: "3.9.16",
TARGET_ARCHITECTURES[14]: "3.10.10",
TARGET_ARCHITECTURES[15]: "3.10.10",
TARGET_ARCHITECTURES[16]: "3.7.16",
TARGET_ARCHITECTURES[17]: "3.7.16",
TARGET_ARCHITECTURES[18]: "3.8.16",
TARGET_ARCHITECTURES[19]: "3.8.16",
TARGET_ARCHITECTURES[20]: "3.9.16",
TARGET_ARCHITECTURES[21]: "3.9.16",
TARGET_ARCHITECTURES[22]: "3.10.10",
TARGET_ARCHITECTURES[23]: "3.10.10",
TARGET_ARCHITECTURES[14]: "3.10.11",
TARGET_ARCHITECTURES[15]: "3.10.11",
TARGET_ARCHITECTURES[16]: "3.11.3",
TARGET_ARCHITECTURES[17]: "3.11.3",
}
POETRY_VERSIONS: dict = {
TARGET_ARCHITECTURES[0]: "1.2.2",
TARGET_ARCHITECTURES[1]: "1.2.2",
TARGET_ARCHITECTURES[2]: "1.2.2",
TARGET_ARCHITECTURES[3]: "1.2.2",
TARGET_ARCHITECTURES[4]: "1.2.2",
TARGET_ARCHITECTURES[5]: "1.2.2",
TARGET_ARCHITECTURES[6]: "1.2.2",
TARGET_ARCHITECTURES[7]: "1.2.2",
TARGET_ARCHITECTURES[8]: "1.3.2",
TARGET_ARCHITECTURES[9]: "1.3.2",
TARGET_ARCHITECTURES[10]: "1.3.2",
TARGET_ARCHITECTURES[11]: "1.3.2",
TARGET_ARCHITECTURES[12]: "1.3.2",
TARGET_ARCHITECTURES[13]: "1.3.2",
TARGET_ARCHITECTURES[14]: "1.3.2",
TARGET_ARCHITECTURES[15]: "1.3.2",
TARGET_ARCHITECTURES[16]: "1.4.1",
TARGET_ARCHITECTURES[17]: "1.4.1",
TARGET_ARCHITECTURES[18]: "1.4.1",
TARGET_ARCHITECTURES[19]: "1.4.1",
TARGET_ARCHITECTURES[20]: "1.4.1",
TARGET_ARCHITECTURES[21]: "1.4.1",
TARGET_ARCHITECTURES[22]: "1.4.1",
TARGET_ARCHITECTURES[23]: "1.4.1",
TARGET_ARCHITECTURES[0]: "1.3.2",
TARGET_ARCHITECTURES[1]: "1.3.2",
TARGET_ARCHITECTURES[2]: "1.3.2",
TARGET_ARCHITECTURES[3]: "1.3.2",
TARGET_ARCHITECTURES[4]: "1.3.2",
TARGET_ARCHITECTURES[5]: "1.3.2",
TARGET_ARCHITECTURES[6]: "1.4.2",
TARGET_ARCHITECTURES[7]: "1.4.2",
TARGET_ARCHITECTURES[8]: "1.4.2",
TARGET_ARCHITECTURES[9]: "1.4.2",
TARGET_ARCHITECTURES[10]: "1.4.2",
TARGET_ARCHITECTURES[11]: "1.4.2",
TARGET_ARCHITECTURES[12]: "1.5.0",
TARGET_ARCHITECTURES[13]: "1.5.0",
TARGET_ARCHITECTURES[14]: "1.5.0",
TARGET_ARCHITECTURES[15]: "1.5.0",
TARGET_ARCHITECTURES[16]: "1.5.0",
TARGET_ARCHITECTURES[17]: "1.5.0",
}
Loading

0 comments on commit 53d9b37

Please sign in to comment.