1
0
mirror of https://github.com/thib8956/nginx-proxy synced 2026-05-10 12:42:40 +00:00

Merge pull request #2566 from SchoNie/python3.12+

ci: python 3.12+ compatibility
This commit is contained in:
Nicolas Duchon
2024-12-18 17:29:28 +01:00
committed by GitHub
4 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -25,10 +25,10 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Set up Python 3.9 - name: Set up Python 3.12
uses: actions/setup-python@v5 uses: actions/setup-python@v5
with: with:
python-version: 3.9 python-version: 3.12
- name: Install dependencies - name: Install dependencies
run: | run: |
+3 -3
View File
@@ -13,7 +13,7 @@ import docker
import pytest import pytest
import requests import requests
from _pytest._code.code import ReprExceptionInfo from _pytest._code.code import ReprExceptionInfo
from distutils.version import LooseVersion from packaging.version import Version
from docker.models.containers import Container from docker.models.containers import Container
from requests.packages.urllib3.util.connection import HAS_IPV6 from requests.packages.urllib3.util.connection import HAS_IPV6
@@ -557,5 +557,5 @@ try:
except docker.errors.ImageNotFound: except docker.errors.ImageNotFound:
pytest.exit("The docker image 'nginxproxy/nginx-proxy:test' is missing") pytest.exit("The docker image 'nginxproxy/nginx-proxy:test' is missing")
if LooseVersion(docker.__version__) < LooseVersion("5.0.0"): if Version(docker.__version__) < Version("7.0.0"):
pytest.exit("This test suite is meant to work with the python docker module v5.0.0 or later") pytest.exit("This test suite is meant to work with the python docker module v7.0.0 or later")
@@ -1,4 +1,4 @@
FROM python:3.9 FROM python:3.12
ENV PYTEST_RUNNING_IN_CONTAINER=1 ENV PYTEST_RUNNING_IN_CONTAINER=1
+2 -2
View File
@@ -1,11 +1,11 @@
import docker import docker
import pytest import pytest
from distutils.version import LooseVersion from packaging.version import Version
raw_version = docker.from_env().version()["Version"] raw_version = docker.from_env().version()["Version"]
pytestmark = pytest.mark.skipif( 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})" reason="Docker compose syntax v3 requires docker engine v1.13 or later (got {raw_version})"
) )