Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@ jobs:
tests:
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest]
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
python-version: '3.6'
# Python 3.7 is not available in GitHub Actions Ubuntu 22.04
- os: ubuntu-latest
python-version: '3.7'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 0 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

### Unreleased

# v14.0.0
- Support Docker compose v2
- Drop Python 3.7 support

# v13.14.2
- Collect additional parameters provided to kubetools cronjob spec and attach to k8s cronjob spec

Expand Down
2 changes: 1 addition & 1 deletion kubetools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from importlib import metadata

__version__ = metadata.version("kubetools")
__version__ = metadata.version('kubetools')
5 changes: 3 additions & 2 deletions kubetools/dev/backends/docker_compose/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,9 @@ def create_compose_config(kubetools_config):
if dev_network:
compose_config['networks'] = {
'default': {
'name': 'dev',
'external': True,
'external': {
'name': 'dev',
},
},
}

Expand Down
9 changes: 6 additions & 3 deletions kubetools/dev/backends/docker_compose/docker_util.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import sys

from functools import lru_cache

import docker
Expand Down Expand Up @@ -136,8 +138,8 @@ def get_containers_status(
if not env:
env = compose_project.replace(docker_name, '')

# Get the service name from the Docker Compose label (works with both v1 and v2)
name = container.labels['com.docker.compose.service']
# Where the name is compose-name_container_N, get container
name = container.name.split('_')[1]

status = container.status == 'running'
ports = []
Expand Down Expand Up @@ -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', '.',
Expand Down
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@ def get_readme_content():
'pyyaml>=3,<6',
'requests>=2,<2.29.0', # https://github.com/docker/docker-py/issues/3113
'pyretry',
'packaging',
# To support CronJob api versions 'batch/v1beta1' & 'batch/v1'
'kubernetes>=21.7.0,<25.0.0',
'tabulate<1',
# compose v2 has broken container naming
'docker-compose<2',
),
extras_require={
'dev': (
Expand Down
Loading