mirror of
				https://github.com/thib8956/nginx-proxy
				synced 2025-11-04 02:59:20 +00:00 
			
		
		
		
	Merge pull request #2566 from SchoNie/python3.12+
ci: python 3.12+ compatibility
This commit is contained in:
		
							
								
								
									
										4
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							@@ -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: |
 | 
			
		||||
 
 | 
			
		||||
@@ -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"):
 | 
			
		||||
    pytest.exit("This test suite is meant to work with the python docker module v5.0.0 or later")
 | 
			
		||||
if Version(docker.__version__) < Version("7.0.0"):
 | 
			
		||||
    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
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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})"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user