1
0
mirror of https://github.com/thib8956/nginx-proxy synced 2025-02-23 17:28:14 +00:00

ci: python 3.12+ compatibility

ci: python 3.12+ compatibility
This commit is contained in:
Niek 2024-12-18 11:34:19 +01:00
parent 2bb0bbe5c9
commit 92eb45f0ec
4 changed files with 7 additions and 7 deletions

View File

@ -25,10 +25,10 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: 3.12
- name: Install dependencies
run: |

View File

@ -13,7 +13,7 @@ import docker
import pytest
import requests
from _pytest._code.code import ReprExceptionInfo
from distutils.version import LooseVersion
from packaging.version import Version
from docker.models.containers import Container
from requests.packages.urllib3.util.connection import HAS_IPV6
@ -557,5 +557,5 @@ try:
except docker.errors.ImageNotFound:
pytest.exit("The docker image 'nginxproxy/nginx-proxy:test' is missing")
if LooseVersion(docker.__version__) < LooseVersion("5.0.0"):
if Version(docker.__version__) < Version("5.0.0"):
pytest.exit("This test suite is meant to work with the python docker module v5.0.0 or later")

View File

@ -1,4 +1,4 @@
FROM python:3.9
FROM python:3.12
ENV PYTEST_RUNNING_IN_CONTAINER=1

View File

@ -1,11 +1,11 @@
import docker
import pytest
from distutils.version import LooseVersion
from packaging.version import Version
raw_version = docker.from_env().version()["Version"]
pytestmark = pytest.mark.skipif(
LooseVersion(raw_version) < LooseVersion("1.13"),
Version(raw_version) < Version("1.13"),
reason="Docker compose syntax v3 requires docker engine v1.13 or later (got {raw_version})"
)