From 148a8832397605c6bb1408ad46868cd4b70217b2 Mon Sep 17 00:00:00 2001 From: Hayden <44925247+Koalacards@users.noreply.github.com> Date: Fri, 14 Oct 2022 08:51:57 -0400 Subject: [PATCH 1/4] Add testing support for 3.9 and 3.10 --- .github/workflows/main.yml | 4 +- .github/workflows/publish_release.yml | 2 +- CHANGELOG.md | 7 +++ docker-compose.yaml | 43 ++++++++++++------- docker/Dockerfile | 2 +- little_cheesemonger/_constants.py | 4 ++ pyproject.toml | 2 +- run_unit_tests.sh | 3 +- setup.cfg | 1 + .../assets/example_package/pyproject.toml | 9 ++-- tests/unit/test_platform.py | 1 + 11 files changed, 54 insertions(+), 24 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d0cfa9e..187e0f7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,7 +5,7 @@ name: CI on: [push, pull_request] env: - PYTHON_VERSION: "3.8.5" + PYTHON_VERSION: "3.10.7" jobs: bandit: @@ -94,7 +94,7 @@ jobs: runs-on: "ubuntu-latest" strategy: matrix: - python-version: [3.6, 3.7, 3.8] + python-version: [3.7, 3.8, 3.9, 3.10] steps: - name: "Check out code" uses: "actions/checkout@v2" diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml index bb4b81a..6fc5e91 100644 --- a/.github/workflows/publish_release.yml +++ b/.github/workflows/publish_release.yml @@ -1,6 +1,6 @@ name: Publish Release env: - PYTHON_VERSION: "3.9" + PYTHON_VERSION: "3.10" on: release: types: [published] diff --git a/CHANGELOG.md b/CHANGELOG.md index 2172639..68aaa3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +* Removed Support for testing in Python 3.6 +* Added Support for testing in Python 3.9 and 3.10 +* Add Python 3.10 support to the PythonVersion constants and pyproject.toml python_versions +* Update workflow testing version to python 3.10.7 + ## [0.2.1] - 2021-10-21 ### Fixed diff --git a/docker-compose.yaml b/docker-compose.yaml index c15ee4b..227bf58 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,16 +1,18 @@ version: '3.4' # Defaults - -x-build-args-36: &build_args_36 - IMAGE_TAG: "3.6-buster" - x-build-args-37: &build_args_37 IMAGE_TAG: "3.7-buster" x-build-args-38: &build_args_38 IMAGE_TAG: "3.8-buster" +x-build-args-39: &build_args_39 + IMAGE_TAG: "3.9-buster" + +x-build-args-310: &build_args_310 + IMAGE_TAG: "3.10-buster" + x-mount-app-and-user-git-config: &mount-app-and-user-git-config volumes: - ./:/app @@ -35,36 +37,47 @@ services: entrypoint: /bin/bash docker/bump_version.sh # Test & Lint suite - - test-36: + + test-37: <<: *dev build: <<: *dev_build args: - IMAGE: python:3.6-buster - image: little-cheesemonger-test-36 + IMAGE: python:3.7-buster + image: little-cheesemonger-test-37 command: docker/run_tests.sh - test-37: + test-38: <<: *dev build: <<: *dev_build args: - IMAGE: python:3.7-buster - image: little-cheesemonger-test-37 + IMAGE: python:3.8-buster + image: little-cheesemonger-test-38 command: docker/run_tests.sh - # NOTE: test-38 command includes `--format-code` option that will + test-39: + <<: *dev + build: + <<: *dev_build + args: + IMAGE: python:3.9-buster + image: little-cheesemonger-test-39 + command: docker/run_tests.sh + + # NOTE: test-310 command includes `--format-code` option that will # apply changes when the lint suite is run - test-38: + test-310: <<: *dev build: <<: *dev_build args: - IMAGE: python:3.8-buster - image: little-cheesemonger-test-38 + IMAGE: python:3.10-buster + image: little-cheesemonger-test-310 command: docker/run_tests.sh --format-code + + test-integration-manylinux1-default-loader: &test_integration build: &test_build dockerfile: ./docker/manylinux.Dockerfile diff --git a/docker/Dockerfile b/docker/Dockerfile index 6f54a5f..30f924a 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -ARG IMAGE=python:3.8-buster +ARG IMAGE=python:3.10-buster FROM ${IMAGE} # Set up user for automatic git branch creation diff --git a/little_cheesemonger/_constants.py b/little_cheesemonger/_constants.py index cd8f227..8734acc 100644 --- a/little_cheesemonger/_constants.py +++ b/little_cheesemonger/_constants.py @@ -22,6 +22,7 @@ class PythonVersion(str, Enum): CP37_CP37M = "cp37-cp37m" CP38_CP38 = "cp38-cp38" CP39_CP39 = "cp39-cp39" + CP310_CP310 = "cp310-cp310" PYTHON_BINARIES = { @@ -34,6 +35,7 @@ class PythonVersion(str, Enum): PythonVersion.CP37_CP37M: Path("/opt/python/cp37-cp37m/bin"), PythonVersion.CP38_CP38: Path("/opt/python/cp38-cp38/bin"), PythonVersion.CP39_CP39: Path("/opt/python/cp39-cp39/bin"), + PythonVersion.CP310_CP310: Path("/opt/python/cp310-cp310/bin"), }, Platform.MANYLINUX2010: { PythonVersion.CP35_CP35M: Path("/opt/python/cp35-cp35m/bin"), @@ -41,6 +43,7 @@ class PythonVersion(str, Enum): PythonVersion.CP37_CP37M: Path("/opt/python/cp37-cp37m/bin"), PythonVersion.CP38_CP38: Path("/opt/python/cp38-cp38/bin"), PythonVersion.CP39_CP39: Path("/opt/python/cp39-cp39/bin"), + PythonVersion.CP310_CP310: Path("/opt/python/cp310-cp310/bin"), }, Platform.MANYLINUX2014: { PythonVersion.CP35_CP35M: Path("/opt/python/cp35-cp35m/bin"), @@ -48,6 +51,7 @@ class PythonVersion(str, Enum): PythonVersion.CP37_CP37M: Path("/opt/python/cp37-cp37m/bin"), PythonVersion.CP38_CP38: Path("/opt/python/cp38-cp38/bin"), PythonVersion.CP39_CP39: Path("/opt/python/cp39-cp39/bin"), + PythonVersion.CP310_CP310: Path("/opt/python/cp310-cp310/bin"), }, } } diff --git a/pyproject.toml b/pyproject.toml index 45d3c32..84e44a1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.black] line-length = 88 -target_version = ['py38'] +target_version = ['py310'] exclude = ''' /( venv diff --git a/run_unit_tests.sh b/run_unit_tests.sh index 69c5a3d..773ebb7 100755 --- a/run_unit_tests.sh +++ b/run_unit_tests.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash set -e -docker-compose run --rm test-36 docker-compose run --rm test-37 docker-compose run --rm test-38 +docker-compose run --rm test-39 +docker-compose run --rm test-310 diff --git a/setup.cfg b/setup.cfg index 1bfad8c..811d71f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -15,6 +15,7 @@ classifiers = Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 [options] diff --git a/tests/integration/assets/example_package/pyproject.toml b/tests/integration/assets/example_package/pyproject.toml index 9971976..948ebab 100644 --- a/tests/integration/assets/example_package/pyproject.toml +++ b/tests/integration/assets/example_package/pyproject.toml @@ -9,7 +9,8 @@ python_versions = [ "cp36-cp36m", "cp36-cp37m", "cp36-cp38", - "cp36-cp39" + "cp36-cp39", + "cp36-cp310" ] python_dependencies = [ "nyancat==0.1.2" @@ -29,7 +30,8 @@ python_versions = [ "cp36-cp36m", "cp36-cp37m", "cp36-cp38", - "cp36-cp39" + "cp36-cp39", + "cp36-cp310" ] python_dependencies = [ "nyancat==0.1.2" @@ -49,7 +51,8 @@ python_versions = [ "cp36-cp36m", "cp36-cp37m", "cp36-cp38", - "cp36-cp39" + "cp36-cp39", + "cp36-cp310" ] python_dependencies = [ "nyancat==0.1.2" diff --git a/tests/unit/test_platform.py b/tests/unit/test_platform.py index 6e14bea..b0ade9d 100644 --- a/tests/unit/test_platform.py +++ b/tests/unit/test_platform.py @@ -64,4 +64,5 @@ def test_get_python_binaries__return_binaries_for_architecture_and_platform(mock PythonVersion.CP37_CP37M: Path("/opt/python/cp37-cp37m/bin"), PythonVersion.CP38_CP38: Path("/opt/python/cp38-cp38/bin"), PythonVersion.CP39_CP39: Path("/opt/python/cp39-cp39/bin"), + PythonVersion.CP310_CP310: Path("/opt/python/cp310-cp310/bin"), } From 7f72ca51bb127a00a7461706263df5cf3ef0d470 Mon Sep 17 00:00:00 2001 From: Hayden <44925247+Koalacards@users.noreply.github.com> Date: Fri, 14 Oct 2022 09:03:40 -0400 Subject: [PATCH 2/4] quick test without 3.10 in matrix --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 187e0f7..8bdf047 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -94,7 +94,7 @@ jobs: runs-on: "ubuntu-latest" strategy: matrix: - python-version: [3.7, 3.8, 3.9, 3.10] + python-version: [3.7, 3.8, 3.9] steps: - name: "Check out code" uses: "actions/checkout@v2" From ec20e4442580b95703f5a3b8f89bfa51fc5d0b64 Mon Sep 17 00:00:00 2001 From: Hayden <44925247+Koalacards@users.noreply.github.com> Date: Fri, 14 Oct 2022 09:08:06 -0400 Subject: [PATCH 3/4] Add back 3.6 testing support --- .github/workflows/main.yml | 2 +- CHANGELOG.md | 1 - docker-compose.yaml | 12 ++++++++++++ run_unit_tests.sh | 1 + 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8bdf047..78ce352 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -94,7 +94,7 @@ jobs: runs-on: "ubuntu-latest" strategy: matrix: - python-version: [3.7, 3.8, 3.9] + python-version: [3.6, 3.7, 3.8, 3.9, 3.10] steps: - name: "Check out code" uses: "actions/checkout@v2" diff --git a/CHANGELOG.md b/CHANGELOG.md index 68aaa3b..e31252f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -* Removed Support for testing in Python 3.6 * Added Support for testing in Python 3.9 and 3.10 * Add Python 3.10 support to the PythonVersion constants and pyproject.toml python_versions * Update workflow testing version to python 3.10.7 diff --git a/docker-compose.yaml b/docker-compose.yaml index 227bf58..4d3d69d 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,6 +1,9 @@ version: '3.4' # Defaults +x-build-args-36: &build_args_36 + IMAGE_TAG: "3.6-buster" + x-build-args-37: &build_args_37 IMAGE_TAG: "3.7-buster" @@ -38,6 +41,15 @@ services: # Test & Lint suite + test-36: + <<: *dev + build: + <<: *dev_build + args: + IMAGE: python:3.6-buster + image: little-cheesemonger-test-36 + command: docker/run_tests.sh + test-37: <<: *dev build: diff --git a/run_unit_tests.sh b/run_unit_tests.sh index 773ebb7..217e12e 100755 --- a/run_unit_tests.sh +++ b/run_unit_tests.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash set -e +docker-compose run --rm test-36 docker-compose run --rm test-37 docker-compose run --rm test-38 docker-compose run --rm test-39 From d64fd3ab242c948f49acfbc89e3cc7168c742dfd Mon Sep 17 00:00:00 2001 From: Hayden <44925247+Koalacards@users.noreply.github.com> Date: Fri, 14 Oct 2022 09:10:17 -0400 Subject: [PATCH 4/4] Quotes around 3.10 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 78ce352..47a22a1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -94,7 +94,7 @@ jobs: runs-on: "ubuntu-latest" strategy: matrix: - python-version: [3.6, 3.7, 3.8, 3.9, 3.10] + python-version: [3.6, 3.7, 3.8, 3.9, '3.10'] steps: - name: "Check out code" uses: "actions/checkout@v2"