From bd9652934ce6bbfe375bb09ef55cb363f9bd5f07 Mon Sep 17 00:00:00 2001 From: Germain Chazot Date: Mon, 11 Mar 2024 16:40:27 +0100 Subject: [PATCH 1/5] Try to use docker-compose installed with the environment instead of just the first one installed in the Path. This is to avoid picking the version (v2) installed by recent docker in the path and is not compatible yet --- kubetools/dev/backends/docker_compose/docker_util.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kubetools/dev/backends/docker_compose/docker_util.py b/kubetools/dev/backends/docker_compose/docker_util.py index a425ff4..42caf91 100644 --- a/kubetools/dev/backends/docker_compose/docker_util.py +++ b/kubetools/dev/backends/docker_compose/docker_util.py @@ -1,3 +1,5 @@ +import sys + from functools import lru_cache import docker @@ -202,7 +204,8 @@ def run_compose_process(kubetools_config, command_args, **kwargs): create_compose_config(kubetools_config) compose_command = [ - 'docker-compose', + # Use current interpreter to run the docker-compose module installed in the same venv + sys.executable, '-m', 'compose', # Force us to look at the current directory, not relative to the compose # filename (ie .kubetools/compose-name.yml). '--project-directory', '.', From c689a8766a5a767d528209624550431c8dfc2fa1 Mon Sep 17 00:00:00 2001 From: Germain Chazot Date: Mon, 11 Mar 2024 16:56:33 +0100 Subject: [PATCH 2/5] Add Python 3.12 to supported versions --- .github/workflows/run_tests.yml | 2 +- setup.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index bb0a84e..c0c86a2 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -7,7 +7,7 @@ jobs: strategy: matrix: os: [ubuntu-20.04, ubuntu-latest] - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11'] + python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] exclude: # Python 3.6 is not available in GitHub Actions Ubuntu 22.04 - os: ubuntu-latest diff --git a/setup.py b/setup.py index 2397cba..ca02058 100644 --- a/setup.py +++ b/setup.py @@ -86,6 +86,7 @@ def get_readme_content(): 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', 'Topic :: Software Development :: Build Tools', 'Topic :: Software Development :: Testing', 'Topic :: System :: Software Distribution', From 59630dfaea28e93d23abe78344fe95232babe14a Mon Sep 17 00:00:00 2001 From: Germain Chazot Date: Mon, 11 Mar 2024 17:49:36 +0100 Subject: [PATCH 3/5] Skip flake8 in Python 3.12 until CPython fix their bug --- .github/workflows/run_tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index c0c86a2..25c288f 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -25,6 +25,8 @@ jobs: - name: Install package run: PIP_CONSTRAINT=/tmp/constraint.txt python -m pip install .[dev] - name: Linting + # Python 3.12 bug breaks flake8: https://github.com/PyCQA/flake8/issues/1905 + if: matrix.python-version != '3.12' run: "flake8" - name: Unit tests run: "pytest --cov" From 687a0f6f55b9b18cff0bf1e2dbec9d4717333641 Mon Sep 17 00:00:00 2001 From: Germain Chazot Date: Mon, 11 Mar 2024 20:51:11 +0100 Subject: [PATCH 4/5] Upgrade workflows to deal with deprecation warnings --- .github/workflows/publish_pypi.yml | 4 ++-- .github/workflows/run_tests.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml index ac6f1a0..315ea48 100644 --- a/.github/workflows/publish_pypi.yml +++ b/.github/workflows/publish_pypi.yml @@ -6,9 +6,9 @@ jobs: publish-to-pypi: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.11' - name: Install build dependencies diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 25c288f..f58cc3e 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -14,9 +14,9 @@ jobs: python-version: '3.6' runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} # See https://github.com/yaml/pyyaml/issues/601 From d4990755fc487d74ea3ab643aedec38bdfbe8b7a Mon Sep 17 00:00:00 2001 From: Germain Chazot Date: Mon, 11 Mar 2024 20:52:55 +0100 Subject: [PATCH 5/5] Prepare release v13.14.0 --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9335256..9d5d9ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ### Unreleased +# v13.14.0 +- Fix docker-compose conflict when kubetools commands are called without activating their venv +- Add Python 3.12 to supported versions, albeit without Flake8 because of CPython bug +- Upgrade GitHub actions workflow to deal with deprecation warnings + # v13.13.1 - Add nodeSelector config to kubetools file - Fix bug where `config` command was not printing the actual `k8s` configs used by `deploy` because it did not take into account the kube-context, whether default or given with `--context`.