Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add python 3.12 support #422

Merged
merged 3 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ linux_arm64_task:
env:
PATH: ${HOME}/.local/bin:${PATH}
CIRRUS_CLONE_SUBMODULES: "true"
HATCH_VERBOSE: 1
matrix:
- IMAGE: "python:3.8-slim"
- 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:
Expand All @@ -37,6 +39,7 @@ macosx_arm64_task:
- PYTHON: "3.9"
- PYTHON: "3.10"
- PYTHON: "3.11"
- PYTHON: "3.12"
install_script:
- brew update
- brew install pyenv
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ concurrency:
cancel-in-progress: true

env:
STABLE_PYTHON_VERSION: "3.11"
STABLE_PYTHON_VERSION: "3.12"
HATCH_VERBOSE: 1
CIBW_BUILD_FRONTEND: build

jobs:
Expand Down
17 changes: 14 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ concurrency:
cancel-in-progress: true

env:
STABLE_PYTHON_VERSION: "3.11"
STABLE_PYTHON_VERSION: "3.12"
PYTEST_ADDOPTS: --color=yes
HATCH_VERBOSE: 1

jobs:
test:
Expand All @@ -28,12 +29,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.0-alpha.0 - 3.13"
experimental: true

steps:
Expand All @@ -59,6 +60,16 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}

test-conlusion:
name: Test matrix complete

runs-on: ubuntu-latest
needs:
- test

steps:
- run: echo "Test matrix completed successfully."

example:
name: Example

Expand Down
23 changes: 18 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ 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",
]

requires-python = ">=3.8, <3.12"
requires-python = ">=3.8"

# Dependencies of Pact Python should be specified using the broadest range
# compatible version unless:
Expand Down Expand Up @@ -87,7 +88,13 @@ 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]
Expand All @@ -110,8 +117,14 @@ artifacts = ["pact/bin/*", "pact/lib/*", "pact/v3/_ffi.*"]
# 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:.}"]
Expand All @@ -125,7 +138,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/}"
Expand Down
Loading