diff --git a/.cirrus.yml b/.cirrus.yml index a52b4f0d5..d632575a7 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -16,6 +16,7 @@ linux_arm64_task: - IMAGE: "python:3.9-slim" - IMAGE: "python:3.10-slim" - IMAGE: "python:3.11-slim" + - IMAGE: "python:3.12-slim" arm_container: image: $IMAGE install_script: @@ -35,6 +36,7 @@ macosx_arm64_task: - PYTHON: "3.9" - PYTHON: "3.10" - PYTHON: "3.11" + - PYTHON: "3.12" install_script: - brew update - brew install pyenv diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aa05b14ac..9bc823788 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ concurrency: cancel-in-progress: true env: - STABLE_PYTHON_VERSION: "3.11" + STABLE_PYTHON_VERSION: "3.12" CIBW_BUILD_FRONTEND: build CIBW_TEST_COMMAND: > python -c diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d6785a55d..96dc5f956 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,7 @@ concurrency: cancel-in-progress: true env: - STABLE_PYTHON_VERSION: "3.11" + STABLE_PYTHON_VERSION: "3.12" PYTEST_ADDOPTS: --color=yes jobs: @@ -28,12 +28,12 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] experimental: [false] include: - # Run tests against the next Python version, but no need for the full list of OSes. os: ubuntu-latest - python-version: "3.12-dev" + python-version: "3.13-alpha.0 - 3.13" experimental: true steps: diff --git a/pyproject.toml b/pyproject.toml index 5b96caacd..db0794426 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3 :: Only", "Topic :: Software Development :: Testing", ] @@ -62,7 +63,7 @@ types = [ "types-requests ~= 2.0", ] test = [ - "aiohttp[speedups] ~= 3.0", + "aiohttp[speedups] ~= 3.9b", "coverage[toml] ~= 7.0", "flask[async] ~= 3.0", "httpx ~= 0.0", @@ -85,14 +86,20 @@ dev = [ ################################################################################ [build-system] -requires = ["hatchling", "packaging", "requests", "cffi"] +requires = [ + "hatchling", + "packaging", + "requests", + "cffi", + "setuptools ; python_version >= '3.12'", +] build-backend = "hatchling.build" [tool.hatch.version] path = "pact/__version__.py" [tool.hatch.build] -include = ["pact/**/*.py", "*.md", "LICENSE"] +include = ["pact/**/*.py", "*.md", "LICENSE"] [tool.hatch.build.targets.wheel] # Ignore the data files in the wheel as their contents are already included @@ -108,8 +115,14 @@ artifacts = ["pact/bin/*", "pact/lib/*"] # Install dev dependencies in the default environment to simplify the developer # workflow. [tool.hatch.envs.default] -features = ["dev"] -extra-dependencies = ["hatchling", "packaging", "requests", "cffi"] +features = ["dev"] +extra-dependencies = [ + "hatchling", + "packaging", + "requests", + "cffi", + "setuptools ; python_version >= '3.12'", +] [tool.hatch.envs.default.scripts] lint = ["black --check --diff {args:.}", "ruff {args:.}", "mypy {args:.}"] @@ -123,7 +136,7 @@ all = ["lint", "test", "example"] features = ["test"] [[tool.hatch.envs.test.matrix]] -python = ["3.8", "3.9", "3.10", "3.11"] +python = ["3.8", "3.9", "3.10", "3.11", "3.12"] [tool.hatch.envs.test.scripts] test = "pytest {args:tests/}" @@ -155,9 +168,9 @@ filterwarnings = [ [tool.coverage.report] exclude_lines = [ "if __name__ == .__main__.:", # Ignore non-runnable code - "if TYPE_CHECKING:", # Ignore typing - "raise NotImplementedError", # Ignore defensive assertions - "@(abc\\.)?abstractmethod", # Ignore abstract methods + "if TYPE_CHECKING:", # Ignore typing + "raise NotImplementedError", # Ignore defensive assertions + "@(abc\\.)?abstractmethod", # Ignore abstract methods ] ################################################################################