mirror of
https://github.com/thib8956/nginx-proxy
synced 2025-02-24 01:38:15 +00:00
ci: python 3.12+ compatibility
ci: python 3.12+ compatibility
This commit is contained in:
parent
2bb0bbe5c9
commit
92eb45f0ec
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
@ -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: |
|
||||||
|
@ -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("5.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 v5.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
|
||||||
|
|
||||||
|
@ -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})"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user