Skip to content

Commit

Permalink
better docker generation to validate each python version in each nox …
Browse files Browse the repository at this point in the history
…session
  • Loading branch information
alexbarcelo committed Feb 10, 2025
1 parent 2201061 commit 0d512f0
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 12 deletions.
3 changes: 2 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import nox

# Define which Python versions to test with
PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12", "3.13"]
PYPROJECT = nox.project.load_toml("pyproject.toml")
PYTHON_VERSIONS = nox.project.python_versions(PYPROJECT)
LATEST_PYTHON_VERSION = PYTHON_VERSIONS[-1]

# Default sessions (these will be executed in Github Actions)
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3 :: Only",
]
requires-python = ">=3.9"
requires-python = ">=3.9,<3.14"
dependencies = [
"aiorwlock>=1.4.0",
"bcrypt>=4.1.1",
Expand Down
10 changes: 8 additions & 2 deletions tests/functional/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import sys

import grpc
import pytest
Expand All @@ -7,8 +8,13 @@


@pytest.fixture(scope="session")
def docker_compose_command():
return "docker compose"
def python_version():
return f"{sys.version_info.major}.{sys.version_info.minor}"


@pytest.fixture(scope="session")
def docker_setup(python_version):
return [f"build --build-arg PYTHON_VERSION={python_version}-bookworm", "up -d"]


@pytest.fixture(scope="session")
Expand Down
12 changes: 8 additions & 4 deletions tests/proxy/proxy_non_owner/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os
import subprocess
import time
import sys

import grpc
import pytest
Expand All @@ -9,8 +8,13 @@


@pytest.fixture(scope="session")
def docker_compose_command():
return "docker compose"
def python_version():
return f"{sys.version_info.major}.{sys.version_info.minor}"


@pytest.fixture(scope="session")
def docker_setup(python_version):
return [f"build --build-arg PYTHON_VERSION={python_version}-bookworm", "up -d"]


@pytest.fixture(scope="session")
Expand Down
12 changes: 8 additions & 4 deletions tests/proxy/proxy_owner/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os
import subprocess
import time
import sys

import grpc
import pytest
Expand All @@ -9,8 +8,13 @@


@pytest.fixture(scope="session")
def docker_compose_command():
return "docker compose"
def python_version():
return f"{sys.version_info.major}.{sys.version_info.minor}"


@pytest.fixture(scope="session")
def docker_setup(python_version):
return [f"build --build-arg PYTHON_VERSION={python_version}-bookworm", "up -d"]


@pytest.fixture(scope="session")
Expand Down

0 comments on commit 0d512f0

Please sign in to comment.