diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 710a0f22c..a0e865751 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -74,6 +74,12 @@ repos: mascot\.svg )$ + - repo: https://github.com/tombi-toml/tombi-pre-commit + rev: v0.9.3 + hooks: + - id: tombi-format + - id: tombi-lint + - repo: local hooks: # Mypy is difficult to run pre-commit's isolated environment as it needs diff --git a/.taplo.toml b/.taplo.toml deleted file mode 100644 index e5eeae78c..000000000 --- a/.taplo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[schema] -path = "taplo://taplo.toml" - -[formatting] -align_entries = true -indent_entries = false -indent_tables = true -reorder_arrays = false -reorder_inline_tables = true -reorder_keys = true diff --git a/.tombi.toml b/.tombi.toml new file mode 100644 index 000000000..622f59bd6 --- /dev/null +++ b/.tombi.toml @@ -0,0 +1,5 @@ +toml-version = "v1.1.0" + +[format] + [format.rules] + indent-sub-tables = true diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 59194417f..360cbadb8 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -11,7 +11,7 @@ "ms-python.mypy-type-checker", "ms-python.python", "redhat.vscode-yaml", - "tamasfe.even-better-toml", - "yzhang.markdown-all-in-one" + "yzhang.markdown-all-in-one", + "tombi-toml.tombi" ] } diff --git a/committed.toml b/committed.toml index 9cc157ebf..c6cbb305d 100644 --- a/committed.toml +++ b/committed.toml @@ -2,11 +2,12 @@ ## Configuration for committed ## ## See + style = "conventional" -line_length = 80 -merge_commit = false -no_fixup = false +line_length = 80 +merge_commit = false +no_fixup = false subject_capitalized = false allowed_types = [ diff --git a/docs/scripts/.ruff.toml b/docs/scripts/.ruff.toml index 21a6c84ee..ee6a3f3bc 100644 --- a/docs/scripts/.ruff.toml +++ b/docs/scripts/.ruff.toml @@ -1,7 +1,8 @@ #:schema https://www.schemastore.org/ruff.json + extend = "../../pyproject.toml" [lint] ignore = [ - "INP001", # Forbid implicit namespaces + "INP001", # Forbid implicit namespaces ] diff --git a/examples/catalog/pyproject.toml b/examples/catalog/pyproject.toml index 9e9ec1dac..7de8d8171 100644 --- a/examples/catalog/pyproject.toml +++ b/examples/catalog/pyproject.toml @@ -1,6 +1,7 @@ #:schema https://www.schemastore.org/pyproject.toml + [project] -name = "pact-python-catalog" +name = "pact-python-catalog" version = "1.0.0" dependencies = [ @@ -15,15 +16,16 @@ requires-python = ">=3.10" [dependency-groups] test = ["pact-python", "pytest~=9.0", "uvicorn~=0.30"] -[tool.uv.sources] -pact-python = { path = "../../" } +[tool] + [tool.uv.sources] + pact-python = { path = "../../" } -[tool.ruff] -extend = "../../pyproject.toml" + [tool.ruff] + extend = "../../pyproject.toml" -[tool.pytest] -addopts = ["--import-mode=importlib"] + [tool.pytest] + addopts = ["--import-mode=importlib"] -log_date_format = "%H:%M:%S" -log_format = "%(asctime)s.%(msecs)03d [%(levelname)-8s] %(name)s: %(message)s" -log_level = "NOTSET" + log_date_format = "%H:%M:%S" + log_format = "%(asctime)s.%(msecs)03d [%(levelname)-8s] %(name)s: %(message)s" + log_level = "NOTSET" diff --git a/examples/http/aiohttp_and_flask/pyproject.toml b/examples/http/aiohttp_and_flask/pyproject.toml index c783c3f1f..dba9a40ea 100644 --- a/examples/http/aiohttp_and_flask/pyproject.toml +++ b/examples/http/aiohttp_and_flask/pyproject.toml @@ -1,27 +1,29 @@ #:schema https://www.schemastore.org/pyproject.json + [project] name = "example-aiohttp-and-flask" description = "Example of using an aiohttp client and Flask server with Pact Python" -dependencies = ["aiohttp~=3.0", "flask~=3.0", "typing-extensions~=4.0"] +version = "1.0.0" requires-python = ">=3.10" -version = "1.0.0" +dependencies = ["aiohttp~=3.0", "flask~=3.0", "typing-extensions~=4.0"] [dependency-groups] -test = ["pact-python", "pytest-asyncio~=1.0", "pytest~=9.0"] +test = ["pact-python", "pytest~=9.0", "pytest-asyncio~=1.0"] -[tool.uv.sources] -pact-python = { path = "../../../" } +[tool] + [tool.pytest] + addopts = ["--import-mode=importlib"] -[tool.ruff] -extend = "../../../pyproject.toml" + asyncio_default_fixture_loop_scope = "session" -[tool.pytest] -addopts = ["--import-mode=importlib"] + log_date_format = "%H:%M:%S" + log_format = "%(asctime)s.%(msecs)03d [%(levelname)-8s] %(name)s: %(message)s" + log_level = "NOTSET" -asyncio_default_fixture_loop_scope = "session" + [tool.ruff] + extend = "../../../pyproject.toml" -log_date_format = "%H:%M:%S" -log_format = "%(asctime)s.%(msecs)03d [%(levelname)-8s] %(name)s: %(message)s" -log_level = "NOTSET" + [tool.uv.sources] + pact-python = { path = "../../../" } diff --git a/examples/http/requests_and_fastapi/pyproject.toml b/examples/http/requests_and_fastapi/pyproject.toml index be469ec87..03b32dfdf 100644 --- a/examples/http/requests_and_fastapi/pyproject.toml +++ b/examples/http/requests_and_fastapi/pyproject.toml @@ -1,28 +1,29 @@ #:schema https://www.schemastore.org/pyproject.json + [project] name = "example-requests-and-fastapi" description = "Example of using a requests client and FastAPI server with Pact Python" -dependencies = ["requests~=2.0", "fastapi~=0.0", "typing-extensions~=4.0"] +version = "1.0.0" requires-python = ">=3.10" -version = "1.0.0" +dependencies = ["fastapi~=0.0", "requests~=2.0", "typing-extensions~=4.0"] [dependency-groups] - test = ["pact-python", "pytest~=9.0", "uvicorn~=0.29"] -[tool.uv.sources] -pact-python = { path = "../../../" } +[tool] + [tool.pytest] + addopts = ["--import-mode=importlib"] -[tool.ruff] -extend = "../../../pyproject.toml" + asyncio_default_fixture_loop_scope = "session" -[tool.pytest] -addopts = ["--import-mode=importlib"] + log_date_format = "%H:%M:%S" + log_format = "%(asctime)s.%(msecs)03d [%(levelname)-8s] %(name)s: %(message)s" + log_level = "NOTSET" -asyncio_default_fixture_loop_scope = "session" + [tool.ruff] + extend = "../../../pyproject.toml" -log_date_format = "%H:%M:%S" -log_format = "%(asctime)s.%(msecs)03d [%(levelname)-8s] %(name)s: %(message)s" -log_level = "NOTSET" + [tool.uv.sources] + pact-python = { path = "../../../" } diff --git a/examples/http/service_consumer_provider/pyproject.toml b/examples/http/service_consumer_provider/pyproject.toml index 96ece6ee1..48fcbe198 100644 --- a/examples/http/service_consumer_provider/pyproject.toml +++ b/examples/http/service_consumer_provider/pyproject.toml @@ -1,26 +1,27 @@ #:schema https://www.schemastore.org/pyproject.json + [project] name = "example-service-consumer-provider" description = "Example of a service acting as both a Pact consumer and provider" -dependencies = ["fastapi~=0.0", "requests~=2.0", "typing-extensions~=4.0"] +version = "1.0.0" requires-python = ">=3.10" -version = "1.0.0" +dependencies = ["fastapi~=0.0", "requests~=2.0", "typing-extensions~=4.0"] [dependency-groups] - test = ["pact-python", "pytest~=9.0", "uvicorn~=0.29"] -[tool.uv.sources] -pact-python = { path = "../../../" } +[tool] + [tool.pytest] + addopts = ["--import-mode=importlib"] -[tool.ruff] -extend = "../../../pyproject.toml" + log_date_format = "%H:%M:%S" + log_format = "%(asctime)s.%(msecs)03d [%(levelname)-8s] %(name)s: %(message)s" + log_level = "NOTSET" -[tool.pytest] -addopts = ["--import-mode=importlib"] + [tool.ruff] + extend = "../../../pyproject.toml" -log_date_format = "%H:%M:%S" -log_format = "%(asctime)s.%(msecs)03d [%(levelname)-8s] %(name)s: %(message)s" -log_level = "NOTSET" + [tool.uv.sources] + pact-python = { path = "../../../" } diff --git a/examples/http/xml_example/pyproject.toml b/examples/http/xml_example/pyproject.toml index 3275a020e..3e72798e8 100644 --- a/examples/http/xml_example/pyproject.toml +++ b/examples/http/xml_example/pyproject.toml @@ -1,27 +1,29 @@ #:schema https://www.schemastore.org/pyproject.json + [project] name = "example-xml" description = "Example of XML contract testing with Pact Python" -dependencies = ["requests~=2.0", "fastapi~=0.0", "typing-extensions~=4.0"] +version = "1.0.0" requires-python = ">=3.10" -version = "1.0.0" +dependencies = ["fastapi~=0.0", "requests~=2.0", "typing-extensions~=4.0"] [dependency-groups] test = ["pact-python", "pytest~=9.0", "uvicorn~=0.29"] -[tool.uv.sources] -pact-python = { path = "../../../" } +[tool] + [tool.pytest] + addopts = ["--import-mode=importlib"] -[tool.ruff] -extend = "../../../pyproject.toml" + asyncio_default_fixture_loop_scope = "session" -[tool.pytest] -addopts = ["--import-mode=importlib"] + log_date_format = "%H:%M:%S" + log_format = "%(asctime)s.%(msecs)03d [%(levelname)-8s] %(name)s: %(message)s" + log_level = "NOTSET" -asyncio_default_fixture_loop_scope = "session" + [tool.ruff] + extend = "../../../pyproject.toml" -log_date_format = "%H:%M:%S" -log_format = "%(asctime)s.%(msecs)03d [%(levelname)-8s] %(name)s: %(message)s" -log_level = "NOTSET" + [tool.uv.sources] + pact-python = { path = "../../../" } diff --git a/pact-python-cli/pyproject.toml b/pact-python-cli/pyproject.toml index fb8ce0569..5e15d93d4 100644 --- a/pact-python-cli/pyproject.toml +++ b/pact-python-cli/pyproject.toml @@ -1,13 +1,14 @@ #:schema https://www.schemastore.org/pyproject.json + [project] +name = "pact-python-cli" +version = "2.5.7.0" description = "Pact CLI bundle for Python" -name = "pact-python-cli" -version = "2.5.7.0" -keywords = ["pact", "cli", "pact-python", "contract-testing"] -license = "MIT" -readme = "README.md" +readme = "README.md" +license = "MIT" +keywords = ["cli", "contract-testing", "pact", "pact-python"] -authors = [{ name = "Joshua Ellis", email = "josh@jpellis.me" }] +authors = [{ name = "Joshua Ellis", email = "josh@jpellis.me" }] maintainers = [{ name = "Joshua Ellis", email = "josh@jpellis.me" }] classifiers = [ @@ -18,160 +19,137 @@ classifiers = [ "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX :: Linux", + "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", - "Programming Language :: Python", "Topic :: Software Development :: Testing", ] requires-python = ">=3.10" [project.urls] - "Bug Tracker" = "https://github.com/pact-foundation/pact-python/issues" - "Changelog" = "https://github.com/pact-foundation/pact-python/blob/main/pact-python-cli/CHANGELOG.md" + "Bug Tracker" = "https://github.com/pact-foundation/pact-python/issues" + "Changelog" = "https://github.com/pact-foundation/pact-python/blob/main/pact-python-cli/CHANGELOG.md" "Documentation" = "https://docs.pact.io" - "Homepage" = "https://pact.io" - "Repository" = "https://github.com/pact-foundation/pact-python" + "Homepage" = "https://pact.io" + "Repository" = "https://github.com/pact-foundation/pact-python" [project.scripts] - pact = "pact_cli:_exec" - pact-broker = "pact_cli:_exec" - pact-message = "pact_cli:_exec" - pact-mock-service = "pact_cli:_exec" - pact-plugin-cli = "pact_cli:_exec" + pact = "pact_cli:_exec" + pact-broker = "pact_cli:_exec" + pact-message = "pact_cli:_exec" + pact_mock_server_cli = "pact_cli:_exec" + pact-mock-service = "pact_cli:_exec" + pact-plugin-cli = "pact_cli:_exec" pact-provider-verifier = "pact_cli:_exec" - pact-stub-server = "pact_cli:_exec" - pact-stub-service = "pact_cli:_exec" - pact_mock_server_cli = "pact_cli:_exec" - pact_verifier_cli = "pact_cli:_exec" - pactflow = "pact_cli:_exec" + pact-stub-server = "pact_cli:_exec" + pact-stub-service = "pact_cli:_exec" + pact_verifier_cli = "pact_cli:_exec" + pactflow = "pact_cli:_exec" [dependency-groups] # Linting and formatting tools use a more narrow specification to ensure # developper consistency. All other dependencies are as above. -dev = ["ruff==0.15.10", { include-group = "test" }, { include-group = "types" }] -test = ["pytest-cov~=7.0", "pytest~=9.0"] +dev = ["ruff==0.15.10", { include-group = "test" }, { include-group = "types" }] +test = ["pytest~=9.0", "pytest-cov~=7.0"] types = ["mypy==1.20.1"] -################################################################################ ## Build System -################################################################################ [build-system] +requires = ["hatchling", "packaging"] build-backend = "hatchling.build" -requires = ["hatchling", "packaging"] - -[tool.hatch] - - [tool.hatch.build] - packages = ["src/pact_cli"] - [tool.hatch.build.targets.wheel.hooks.custom] - patch = "hatch_build.py" - - ######################################## - ## Hatch Environment Configuration - ######################################## - [tool.hatch.envs] - - # Install dev dependencies in the default environment to simplify the developer - # workflow. - [tool.hatch.envs.default] - extra-dependencies = [ - "hatchling", - "packaging", - "requests", - "setuptools ; python_version >= '3.12'", +[tool] + [tool.cibuildwheel] + # The repair tool unfortunately did not like the bundled Ruby distributable, + # with false-positives missing libraries despite being bundled. + repair-wheel-command = "" + + [tool.cibuildwheel.windows] + archs = ["auto64"] + + [[tool.cibuildwheel.overrides]] + environment.MACOSX_DEPLOYMENT_TARGET = "10.13" + select = "*-macosx_x86_64" + + [[tool.cibuildwheel.overrides]] + environment.MACOSX_DEPLOYMENT_TARGET = "11.0" + select = "*-macosx_arm64" + + [tool.coverage] + [tool.coverage.paths] + pact-cli = ["/src/pact_cli"] + tests = ["/tests"] + + [tool.coverage.report] + exclude_lines = [ + "@(abc\\.)?abstractmethod", # Ignore abstract methods + "if TYPE_CHECKING:", # Ignore typing + "if __name__ == .__main__.:", # Ignore non-runnable code + "raise NotImplementedError", # Ignore defensive assertions ] - installer = "uv" - path = ".venv" - pre-install-commands = ["uv pip install --group dev -e ."] - - [tool.hatch.envs.default.scripts] - all = ["format", "lint", "test", "typecheck"] - format = "ruff format {args}" - lint = "ruff check --show-fixes {args}" - test = "pytest tests/ {args}" - typecheck = ["typecheck-src", "typecheck-tests"] - typecheck-src = "mypy src/ {args}" - typecheck-tests = "mypy tests/ {args}" - - # Test environment for running unit tests. This automatically tests against all - # supported Python versions. - [tool.hatch.envs.test] - installer = "uv" - path = ".venv/test" - pre-install-commands = ["uv pip install --group test -e ."] - - [[tool.hatch.envs.test.matrix]] - python = ["3.10", "3.11", "3.12", "3.13", "3.14"] - -################################################################################ -## PyTest Configuration -################################################################################ -[tool.pytest] -addopts = [ - "--import-mode=importlib", - # Coverage options - "--cov-config=pyproject.toml", - "--cov-report=xml", - "--cov=pact_cli", -] -log_date_format = "%H:%M:%S" -log_format = "%(asctime)s.%(msecs)03d [%(levelname)-8s] %(name)s: %(message)s" -log_level = "NOTSET" - -################################################################################ -## Coverage -################################################################################ -[tool.coverage] - - [tool.coverage.paths] - pact-cli = ["/src/pact_cli"] - tests = ["/tests"] - - [tool.coverage.report] - exclude_lines = [ - "@(abc\\.)?abstractmethod", # Ignore abstract methods - "if TYPE_CHECKING:", # Ignore typing - "if __name__ == .__main__.:", # Ignore non-runnable code - "raise NotImplementedError", # Ignore defensive assertions + [tool.hatch] + [tool.hatch.build] + packages = ["src/pact_cli"] + + [tool.hatch.build.targets.wheel.hooks.custom] + patch = "hatch_build.py" + + [tool.hatch.envs] + [tool.hatch.envs.default] + installer = "uv" + path = ".venv" + extra-dependencies = [ + "hatchling", + "packaging", + "requests", + "setuptools ; python_version >= '3.12'", + ] + dependency-groups = ["dev"] + + [tool.hatch.envs.default.scripts] + all = ["format", "lint", "test", "typecheck"] + format = "ruff format {args}" + lint = "ruff check --show-fixes {args}" + test = "pytest tests/ {args}" + typecheck = ["typecheck-src", "typecheck-tests"] + typecheck-src = "mypy src/ {args}" + typecheck-tests = "mypy tests/ {args}" + + # Test environment for running unit tests. + [tool.hatch.envs.test] + installer = "uv" + path = ".venv/test" + dependency-groups = ["test"] + + [[tool.hatch.envs.test.matrix]] + python = ["3.10", "3.11", "3.12", "3.13", "3.14"] + + [tool.mypy] + # Overwrite the exclusions from the root pyproject.toml. + exclude = "" + + ## PyTest Configuration + [tool.pytest] + addopts = [ + # Coverage options + "--cov-config=pyproject.toml", + "--cov-report=xml", + "--cov=pact_cli", + "--import-mode=importlib", ] -################################################################################ -## Ruff Configuration -################################################################################ -[tool.ruff] -extend = "../pyproject.toml" - -exclude = [] - -################################################################################ -## Mypy Configuration -################################################################################ -[tool.mypy] -# Overwrite the exclusions from the root pyproject.toml. -exclude = '' - -################################################################################ -## CI Build Wheel -################################################################################ -[tool.cibuildwheel] -# The repair tool unfortunately did not like the bundled Ruby distributable, -# with false-positives missing libraries despite being bundled. -repair-wheel-command = "" - - [tool.cibuildwheel.windows] - archs = ["auto64"] - - [[tool.cibuildwheel.overrides]] - environment.MACOSX_DEPLOYMENT_TARGET = "10.13" - select = "*-macosx_x86_64" - - [[tool.cibuildwheel.overrides]] - environment.MACOSX_DEPLOYMENT_TARGET = "11.0" - select = "*-macosx_arm64" + log_date_format = "%H:%M:%S" + log_format = "%(asctime)s.%(msecs)03d [%(levelname)-8s] %(name)s: %(message)s" + log_level = "NOTSET" + + ## Ruff Configuration + [tool.ruff] + extend = "../pyproject.toml" + + exclude = [] diff --git a/pact-python-ffi/pyproject.toml b/pact-python-ffi/pyproject.toml index 35dc65a8d..dc0e64993 100644 --- a/pact-python-ffi/pyproject.toml +++ b/pact-python-ffi/pyproject.toml @@ -1,13 +1,14 @@ #:schema https://www.schemastore.org/pyproject.json + [project] +name = "pact-python-ffi" +version = "0.4.28.2" description = "Python bindings for the Pact FFI library" -name = "pact-python-ffi" -version = "0.4.28.2" -keywords = ["pact", "ffi", "pact-python", "contract-testing"] -license = "MIT" -readme = "README.md" +readme = "README.md" +license = "MIT" +keywords = ["contract-testing", "ffi", "pact", "pact-python"] -authors = [{ name = "Joshua Ellis", email = "josh@jpellis.me" }] +authors = [{ name = "Joshua Ellis", email = "josh@jpellis.me" }] maintainers = [{ name = "Joshua Ellis", email = "josh@jpellis.me" }] classifiers = [ @@ -18,13 +19,13 @@ classifiers = [ "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX :: Linux", + "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", - "Programming Language :: Python", "Topic :: Software Development :: Testing", ] @@ -33,163 +34,127 @@ requires-python = ">=3.10" dependencies = ["cffi~=2.0"] [project.urls] - "Bug Tracker" = "https://github.com/pact-foundation/pact-python/issues" - "Changelog" = "https://github.com/pact-foundation/pact-python/blob/main/pact-python-ffi/CHANGELOG.md" + "Bug Tracker" = "https://github.com/pact-foundation/pact-python/issues" + "Changelog" = "https://github.com/pact-foundation/pact-python/blob/main/pact-python-ffi/CHANGELOG.md" "Documentation" = "https://docs.pact.io" - "Homepage" = "https://pact.io" - "Repository" = "https://github.com/pact-foundation/pact-python" + "Homepage" = "https://pact.io" + "Repository" = "https://github.com/pact-foundation/pact-python" [dependency-groups] -dev = ["ruff==0.15.10", { include-group = "test" }, { include-group = "types" }] -test = ["pytest-cov~=7.0", "pytest~=9.0"] +dev = ["ruff==0.15.10", { include-group = "test" }, { include-group = "types" }] +test = ["pytest~=9.0", "pytest-cov~=7.0"] types = ["mypy==1.20.1", "typing-extensions~=4.0"] -################################################################################ -## Build System -################################################################################ [build-system] +requires = ["cffi", "hatchling", "packaging", "setuptools"] build-backend = "hatchling.build" -requires = ["hatchling", "packaging", "cffi", "setuptools"] - -[tool.hatch] - - [tool.hatch.build] - packages = ["src/pact_ffi"] - - [tool.hatch.build.targets.wheel.hooks.custom] - patch = "hatch_build.py" - - ######################################## - ## Hatch Environment Configuration - ######################################## - [tool.hatch.envs] - - # Install dev dependencies in the default environment to simplify the developer - # workflow. - [tool.hatch.envs.default] - extra-dependencies = ["hatchling", "packaging", "cffi"] - installer = "uv" - path = ".venv" - pre-install-commands = ["uv pip install --group dev -e ."] - - # Update paths to ensure the shared library can be found - # TODO: See if this can be overridden on a per-platform basis - # https://github.com/pypa/hatch/discussions/2024 - # [tool.hatch.envs.default.overrides] - # platform.windows.env-vars = { PATH = "{root}/src/pact_ffi;{env:PATH}" } - - [tool.hatch.envs.default.scripts] - all = ["format", "lint", "test", "typecheck"] - format = "ruff format {args}" - lint = "ruff check --show-fixes {args}" - test = "pytest tests/ {args}" - typecheck = ["typecheck-src", "typecheck-tests"] - typecheck-src = "mypy src/ {args}" - typecheck-tests = "mypy tests/ {args}" - - # Test environment for running unit tests. This automatically tests against all - # supported Python versions. - [tool.hatch.envs.test] - installer = "uv" - path = ".venv/test" - pre-install-commands = ["uv pip install --group test -e ."] - - # Update paths to ensure the shared library can be found - # TODO: See if this can be overridden on a per-platform basis - # https://github.com/pypa/hatch/discussions/2024 - # [tool.hatch.envs.default.overrides] - # platform.windows.env-vars = { PATH = "{root}/src/pact_ffi;{env:PATH}" } - - [[tool.hatch.envs.test.matrix]] - python = ["3.10", "3.11", "3.12", "3.13", "3.14"] - -################################################################################ -## PyTest Configuration -################################################################################ -[tool.pytest] -addopts = [ - "--import-mode=importlib", - # Coverage options - "--cov-config=pyproject.toml", - "--cov-report=xml", - "--cov=pact_ffi", -] -log_date_format = "%H:%M:%S" -log_format = "%(asctime)s.%(msecs)03d [%(levelname)-8s] %(name)s: %(message)s" -log_level = "NOTSET" - -################################################################################ -## Coverage -################################################################################ -[tool.coverage] - - [tool.coverage.paths] - pact-ffi = ["/src/pact_ffi"] - tests = ["/tests"] - - [tool.coverage.report] - exclude_lines = [ - "@(abc\\.)?abstractmethod", # Ignore abstract methods - "if TYPE_CHECKING:", # Ignore typing - "if __name__ == .__main__.:", # Ignore non-runnable code - "raise NotImplementedError", # Ignore defensive assertions +[tool] + [tool.cibuildwheel] + environment.HATCH_VERBOSE = "1" + + [tool.cibuildwheel.linux] + before-build = ["uv pip install --system abi3audit"] + environment.PACT_LIB_DIR = "/tmp/pact_ffi" + repair-wheel-command = [ + "export LD_LIBRARY_PATH=\"$PACT_LIB_DIR:$LD_LIBRARY_PATH\"", + "auditwheel repair -w {dest_dir} {wheel}", + "abi3audit --strict --report {wheel}", + ] + + [tool.cibuildwheel.macos] + before-build = ["pip install abi3audit"] + environment.PACT_LIB_DIR = "/tmp/pact_ffi" + repair-wheel-command = [ + "export DYLD_LIBRARY_PATH=\"$PACT_LIB_DIR:$DYLD_LIBRARY_PATH\"", + "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}", + "abi3audit --strict --report {wheel}", + ] + + [tool.cibuildwheel.windows] + archs = ["auto64"] + before-build = ["pip install abi3audit delvewheel"] + environment.PACT_LIB_DIR = "C:/tmp/pact_ffi" + repair-wheel-command = [ + "delvewheel repair -vv --add-path \"%PACT_LIB_DIR%\" -w {dest_dir} {wheel}", + "abi3audit --strict --report {wheel}", + ] + + [[tool.cibuildwheel.overrides]] + environment.MACOSX_DEPLOYMENT_TARGET = "12.0" + inherit.environment = "append" + select = "*-macosx_x86_64" + + [[tool.cibuildwheel.overrides]] + environment.MACOSX_DEPLOYMENT_TARGET = "12.0" + inherit.environment = "append" + select = "*-macosx_arm64" + + [tool.coverage] + [tool.coverage.paths] + pact-ffi = ["/src/pact_ffi"] + tests = ["/tests"] + + [tool.coverage.report] + exclude_lines = [ + "@(abc\\.)?abstractmethod", # Ignore abstract methods + "if TYPE_CHECKING:", # Ignore typing + "if __name__ == .__main__.:", # Ignore non-runnable code + "raise NotImplementedError", # Ignore defensive assertions + ] + + [tool.hatch] + [tool.hatch.build] + packages = ["src/pact_ffi"] + + [tool.hatch.build.targets.wheel.hooks.custom] + patch = "hatch_build.py" + + [tool.hatch.envs] + [tool.hatch.envs.default] + installer = "uv" + path = ".venv" + extra-dependencies = ["hatchling", "packaging", "cffi"] + dependency-groups = ["dev"] + + [tool.hatch.envs.default.scripts] + all = ["format", "lint", "test", "typecheck"] + format = "ruff format {args}" + lint = "ruff check --show-fixes {args}" + test = "pytest tests/ {args}" + typecheck = ["typecheck-src", "typecheck-tests"] + typecheck-src = "mypy src/ {args}" + typecheck-tests = "mypy tests/ {args}" + + # Test environment for running unit tests. + [tool.hatch.envs.test] + installer = "uv" + path = ".venv/test" + dependency-groups = ["test"] + + [[tool.hatch.envs.test.matrix]] + python = ["3.10", "3.11", "3.12", "3.13", "3.14"] + + [tool.mypy] + # Overwrite the exclusions from the root pyproject.toml. + exclude = "" + + ## PyTest Configuration + [tool.pytest] + addopts = [ + # Coverage options + "--cov-config=pyproject.toml", + "--cov-report=xml", + "--cov=pact_ffi", + "--import-mode=importlib", ] -################################################################################ -## Ruff Configuration -################################################################################ -[tool.ruff] -extend = "../pyproject.toml" - -exclude = [] - -################################################################################ -## Mypy Configuration -################################################################################ -[tool.mypy] -# Overwrite the exclusions from the root pyproject.toml. -exclude = '' - -################################################################################ -## CI Build Wheel -################################################################################ -[tool.cibuildwheel] -environment.HATCH_VERBOSE = "1" - - [tool.cibuildwheel.linux] - before-build = ["uv pip install --system abi3audit"] - environment.PACT_LIB_DIR = "/tmp/pact_ffi" - repair-wheel-command = [ - "export LD_LIBRARY_PATH=\"$PACT_LIB_DIR:$LD_LIBRARY_PATH\"", - "auditwheel repair -w {dest_dir} {wheel}", - "abi3audit --strict --report {wheel}", - ] - - [tool.cibuildwheel.macos] - before-build = ["pip install abi3audit"] - environment.PACT_LIB_DIR = "/tmp/pact_ffi" - repair-wheel-command = [ - "export DYLD_LIBRARY_PATH=\"$PACT_LIB_DIR:$DYLD_LIBRARY_PATH\"", - "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}", - "abi3audit --strict --report {wheel}", - ] - - [tool.cibuildwheel.windows] - archs = ["auto64"] - before-build = ["pip install abi3audit delvewheel"] - environment.PACT_LIB_DIR = "C:/tmp/pact_ffi" - repair-wheel-command = [ - "delvewheel repair -vv --add-path \"%PACT_LIB_DIR%\" -w {dest_dir} {wheel}", - "abi3audit --strict --report {wheel}", - ] + log_date_format = "%H:%M:%S" + log_format = "%(asctime)s.%(msecs)03d [%(levelname)-8s] %(name)s: %(message)s" + log_level = "NOTSET" - [[tool.cibuildwheel.overrides]] - environment.MACOSX_DEPLOYMENT_TARGET = "12.0" - inherit.environment = "append" - select = "*-macosx_x86_64" + ## Ruff Configuration + [tool.ruff] + extend = "../pyproject.toml" - [[tool.cibuildwheel.overrides]] - environment.MACOSX_DEPLOYMENT_TARGET = "12.0" - inherit.environment = "append" - select = "*-macosx_arm64" + exclude = [] diff --git a/pact-python-ffi/tests/.ruff.toml b/pact-python-ffi/tests/.ruff.toml index 3558b7bba..ee08a6db7 100644 --- a/pact-python-ffi/tests/.ruff.toml +++ b/pact-python-ffi/tests/.ruff.toml @@ -1,16 +1,17 @@ #:schema https://www.schemastore.org/ruff.json + extend = "../pyproject.toml" # We have a number of helper files which contain assertions/magic values, etc. [lint] ignore = [ - "D102", # Require docstring in public methods - "D103", # Require docstring in public function - "D104", # Require docstring in public package + "D102", # Require docstring in public methods + "D103", # Require docstring in public function + "D104", # Require docstring in public package "INP001", # Forbid implicit namespaces - "PLR2004", # Forbid magic values + "PLR2004", # Forbid magic values "RUF018", # Forbid assignment in assertions - "S101", # Forbid assert statements + "S101", # Forbid assert statements "TID252", # Require absolute imports ] diff --git a/pyproject.toml b/pyproject.toml index 31e55c8e1..59043c67b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,11 +1,12 @@ #:schema https://www.schemastore.org/pyproject.json + [project] +name = "pact-python" +version = "3.2.1" description = "Tool for creating and verifying consumer-driven contracts using the Pact framework." -name = "pact-python" -version = "3.2.1" +readme = "README.md" +license = { file = "LICENSE" } keywords = ["contract-testing", "pact", "testing"] -license = { file = "LICENSE" } -readme = "README.md" authors = [ { name = "Joshua Ellis", email = "josh@jpellis.me" }, @@ -21,13 +22,13 @@ classifiers = [ "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX :: Linux", + "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", - "Programming Language :: Python", "Topic :: Software Development :: Testing", ] @@ -41,17 +42,17 @@ requires-python = ">=3.10" dependencies = [ # Pact dependencies "pact-python-ffi~=0.4.0", + "typing-extensions~=4.0 ; python_version < '3.13'", # External dependencies "yarl~=1.0", - "typing-extensions~=4.0 ; python_version < '3.13'", ] [project.urls] - changelog = "https://github.com/pact-foundation/pact-python/blob/main/CHANGELOG.md" + changelog = "https://github.com/pact-foundation/pact-python/blob/main/CHANGELOG.md" documentation = "https://pact-foundation.github.io/pact-python/" - homepage = "https://pact.io" - issues = "https://github.com/pact-foundation/pact-python/issues" - source = "https://github.com/pact-foundation/pact-python" + homepage = "https://pact.io" + issues = "https://github.com/pact-foundation/pact-python/issues" + source = "https://github.com/pact-foundation/pact-python" [project.scripts] pact-verifier = "pact.v2.cli.verify:main" @@ -75,10 +76,10 @@ dev = [ "ruff==0.15.10", { include-group = "docs" }, { include-group = "example" }, - { include-group = "test" }, - { include-group = "types" }, { include-group = "example-v2" }, + { include-group = "test" }, { include-group = "test-v2" }, + { include-group = "types" }, ] docs = [ @@ -86,13 +87,13 @@ docs = [ "griffe-inherited-method-crossrefs==0.0.1.4", "griffe-pydantic==1.3.1", "griffe-warnings-deprecated==1.1.1", + "mkdocs==1.6.1", "mkdocs-gen-files==0.6.1", "mkdocs-github-admonitions-plugin==0.1.1", "mkdocs-literate-nav==0.6.3", "mkdocs-llmstxt==0.5.0", "mkdocs-material[recommended,git,imaging]==9.7.6", "mkdocs-section-index==0.3.11", - "mkdocs==1.6.1", "mkdocstrings[python]==1.0.4", "pathspec==1.0.4", ] @@ -102,9 +103,9 @@ example = [ "grpcio~=1.0", "protobuf~=7.34", "pydantic~=2.0", + "pytest~=9.0", "pytest-cov~=7.0", "pytest-rerunfailures~=16.0", - "pytest~=9.0", "python-multipart~=0.0", "testcontainers~=4.0", "uvicorn[standard]~=0.0", @@ -113,11 +114,11 @@ test = [ "aiohttp~=3.0", "flask~=3.0", "pact-python-cli", + "pytest~=9.0", "pytest-asyncio~=1.0", "pytest-bdd~=8.0", "pytest-cov~=7.0", "pytest-rerunfailures~=16.0", - "pytest~=9.0", "requests~=2.0", "testcontainers~=4.0", ] @@ -126,17 +127,16 @@ types = [ "types-grpcio~=1.0", "types-protobuf~=7.34", "types-requests~=2.0", - # This is required for Python 3.10 support - "typing-extensions~=4.0", + "typing-extensions~=4.0", # For Python 3.10 support ] # Dependencies for v2 example and test environments example-v2 = [ "fastapi~=0.0", "flask[async]~=3.0", + "pytest~=9.0", "pytest-cov~=7.0", "pytest-rerunfailures~=16.0", - "pytest~=9.0", "testcontainers~=4.0", "uvicorn[standard]~=0.0", ] @@ -144,249 +144,195 @@ test-v2 = [ "fastapi~=0.0", "httpx~=0.0", "mock~=5.0", + "pytest~=9.0", "pytest-cov~=7.0", "pytest-rerunfailures~=16.0", - "pytest~=9.0", "uvicorn[standard]~=0.0", ] -################################################################################ -## Hatch Configuration -################################################################################ [build-system] +requires = ["hatchling"] build-backend = "hatchling.build" -requires = ["hatchling"] - -[tool.hatch] - - [tool.hatch.build] - packages = ["src/pact"] - - ######################################## - ## Hatch Environment Configuration - ######################################## - [tool.hatch.envs] - - # Install dev dependencies in the default environment to simplify the developer - # workflow. - [tool.hatch.envs.default] - extra-dependencies = ["hatchling", "packaging"] - installer = "uv" - path = ".venv" - # This is require to get around an incompatibility between hatch and uv - # See: https://github.com/pypa/hatch/issues/1639 - # See: https://github.com/pypa/hatch/issues/1852 - pre-install-commands = [ - "uv pip install --group dev -e .", - "uv pip install --group dev -e ./pact-python-ffi", - "uv pip install --group dev -e ./pact-python-cli", - ] # - - # Update paths to ensure the shared library can be found - # TODO: See if this can be overridden on a per-platform basis - # https://github.com/pypa/hatch/discussions/2024 - # [tool.hatch.envs.default.overrides] - # platform.windows.env-vars = { PATH = "{root}/src/pact_ffi;{env:PATH}" } - - [tool.hatch.envs.default.scripts] - all = ["example", "format", "lint", "test", "typecheck"] - docs = "mkdocs serve {args}" - docs-build = "mkdocs build {args}" - example = "pytest --ignore=examples/v2 examples/ {args}" - format = "ruff format {args}" - lint = "ruff check --output-format=full --show-fixes {args}" - test = "pytest --ignore=tests/v2 tests/ {args}" - typecheck = ["typecheck-examples", "typecheck-src", "typecheck-tests"] - typecheck-examples = "mypy examples/ {args}" - typecheck-src = "mypy src/ {args}" - typecheck-tests = "mypy tests/ {args}" - - # Test environment for running unit tests. - [tool.hatch.envs.test] - installer = "uv" - path = ".venv/test" - pre-install-commands = ["uv pip install --group test -e ."] - - [[tool.hatch.envs.test.matrix]] - python = ["3.10", "3.11", "3.12", "3.13", "3.14"] - - # Test environment for running unit tests. This automatically tests against all - # supported Python versions. - [tool.hatch.envs.example] - installer = "uv" - path = ".venv/example" - pre-install-commands = ["uv pip install --group example -e ."] - - [tool.hatch.envs.example.scripts] - all = ["example"] - - [[tool.hatch.envs.example.matrix]] - python = ["3.10", "3.11", "3.12", "3.13", "3.14"] - - [tool.hatch.envs.v2-test] - features = ["compat-v2"] - installer = "uv" - path = ".venv/v2-test" - pre-install-commands = ["uv pip install --group test-v2 -e ."] - - [tool.hatch.envs.v2-test.scripts] - all = ["test"] - test = "pytest tests/v2 {args}" - - [[tool.hatch.envs.v2-test.matrix]] - python = ["3.10", "3.11", "3.12", "3.13", "3.14"] - - [tool.hatch.envs.v2-example] - features = ["compat-v2"] - installer = "uv" - path = ".venv/v2-example" - pre-install-commands = ["uv pip install --group example-v2 -e ."] - - [tool.hatch.envs.v2-example.scripts] - all = ["example"] - example = "pytest examples/v2 {args}" - - [[tool.hatch.envs.v2-example.matrix]] - python = ["3.10", "3.11", "3.12", "3.13", "3.14"] - -################################################################################ -## UV Workspace -################################################################################ -[tool.uv] - [tool.uv.sources] - pact-python-cli = { workspace = true } - pact-python-ffi = { workspace = true } - - [tool.uv.workspace] - members = ["pact-python-cli", "pact-python-ffi"] - -################################################################################ -## PyTest Configuration -################################################################################ -[tool.pytest] -addopts = [ - "--import-mode=importlib", - # Coverage options - "--cov-config=pyproject.toml", - "--cov-report=xml", - "--cov=pact", - # Reruns - "--reruns=5", -] -asyncio_default_fixture_loop_scope = "session" +[tool] + [tool.coverage] + [tool.coverage.paths] + pact = ["/src/pact"] + tests = ["/examples", "/tests"] + + [tool.coverage.report] + exclude_lines = [ + "@(abc\\.)?abstractmethod", # Ignore abstract methods + "if TYPE_CHECKING:", # Ignore typing + "if __name__ == .__main__.:", # Ignore non-runnable code + "raise NotImplementedError", # Ignore defensive assertions + ] -filterwarnings = [ - "ignore::DeprecationWarning:examples", - "ignore::DeprecationWarning:pact", - "ignore::DeprecationWarning:tests", -] + [tool.hatch] + [tool.hatch.build] + packages = ["src/pact"] + + [tool.hatch.envs] + [tool.hatch.envs.default] + installer = "uv" + path = ".venv" + extra-dependencies = ["hatchling", "packaging"] + dependency-groups = ["dev"] + + [tool.hatch.envs.default.workspace] + parallel = true + members = [ + { path = "pact-python-cli", group = "dev" }, + { path = "pact-python-ffi", group = "dev" }, + ] + + [tool.hatch.envs.default.scripts] + all = ["example", "format", "lint", "test", "typecheck"] + docs = "mkdocs serve {args}" + docs-build = "mkdocs build {args}" + example = "pytest --ignore=examples/v2 examples/ {args}" + format = "ruff format {args}" + lint = "ruff check --output-format=full --show-fixes {args}" + test = "pytest --ignore=tests/v2 tests/ {args}" + typecheck = ["typecheck-examples", "typecheck-src", "typecheck-tests"] + typecheck-examples = "mypy examples/ {args}" + typecheck-src = "mypy src/ {args}" + typecheck-tests = "mypy tests/ {args}" + + # Test environment for running unit tests. + [tool.hatch.envs.test] + installer = "uv" + path = ".venv/test" + dependency-groups = ["test"] + + [[tool.hatch.envs.test.matrix]] + python = ["3.10", "3.11", "3.12", "3.13", "3.14"] + + [tool.hatch.envs.example] + installer = "uv" + path = ".venv/example" + dependency-groups = ["example"] + + [[tool.hatch.envs.example.matrix]] + python = ["3.10", "3.11", "3.12", "3.13", "3.14"] + + [tool.hatch.envs.v2-test] + features = ["compat-v2"] + installer = "uv" + path = ".venv/v2-test" + pre-install-commands = ["uv pip install --group test-v2 -e ."] + + [tool.hatch.envs.v2-test.scripts] + all = ["test"] + test = "pytest tests/v2 {args}" + + [[tool.hatch.envs.v2-test.matrix]] + python = ["3.10", "3.11", "3.12", "3.13", "3.14"] + + [tool.hatch.envs.v2-example] + features = ["compat-v2"] + installer = "uv" + path = ".venv/v2-example" + pre-install-commands = ["uv pip install --group example-v2 -e ."] + + [tool.hatch.envs.v2-example.scripts] + all = ["example"] + example = "pytest examples/v2 {args}" + + [[tool.hatch.envs.v2-example.matrix]] + python = ["3.10", "3.11", "3.12", "3.13", "3.14"] + + [tool.mypy] + exclude = """(?x)^( + (src/pact|tests|examples)/v2/.*\\.pyi? + )$""" + + [tool.pytest] + addopts = [ + # Coverage options + "--cov-config=pyproject.toml", + "--cov-report=xml", + "--cov=pact", + "--import-mode=importlib", + # Reruns + "--reruns=5", + ] -log_date_format = "%H:%M:%S" -log_format = "%(asctime)s.%(msecs)03d [%(levelname)-8s] %(name)s: %(message)s" -log_level = "NOTSET" + asyncio_default_fixture_loop_scope = "session" -markers = [ - # Marker for tests that require a container - "container", + filterwarnings = [ + "ignore::DeprecationWarning:examples", + "ignore::DeprecationWarning:pact", + "ignore::DeprecationWarning:tests", + ] - # Markers for the compatibility suite - "consumer", - "message", - "provider", -] + log_date_format = "%H:%M:%S" + log_format = "%(asctime)s.%(msecs)03d [%(levelname)-8s] %(name)s: %(message)s" + log_level = "NOTSET" -################################################################################ -## Coverage -################################################################################ -[tool.coverage] - - [tool.coverage.paths] - pact = ["/src/pact"] - tests = ["/examples", "/tests"] - - [tool.coverage.report] - exclude_lines = [ - "@(abc\\.)?abstractmethod", # Ignore abstract methods - "if TYPE_CHECKING:", # Ignore typing - "if __name__ == .__main__.:", # Ignore non-runnable code - "raise NotImplementedError", # Ignore defensive assertions - ] + markers = [ + # Marker for tests that require a container + "container", -################################################################################ -## Ruff Configuration -################################################################################ -[tool.ruff] -extend-exclude = ["src/pact/v2/*", "tests/v2/*", "examples/v2/*"] - - [tool.ruff.lint] - select = ["ALL"] - - ignore = [ - "D200", # Require single line docstrings to be on one line. - "D203", # Require blank line before class docstring - "D212", # Multi-line docstring summary must start at the first line - "FIX002", # Forbid TODO in comments - "TD002", # Assign someone to 'TODO' comments - - # The following are disabled for compatibility with the formatter - "COM812", # enforce trailing commas - "ISC001", # require imports to be sorted + # Markers for the compatibility suite + "consumer", + "message", + "provider", ] - [tool.ruff.lint.pyupgrade] - keep-runtime-typing = true - - [tool.ruff.lint.pydocstyle] - convention = "google" + [tool.ruff] + extend-exclude = ["src/pact/v2/*", "tests/v2/*", "examples/v2/*"] - [tool.ruff.lint.isort] - known-first-party = ["pact", "pact_cli", "pact_ffi"] + [tool.ruff.lint] + select = ["ALL"] - [tool.ruff.lint.flake8-tidy-imports] - ban-relative-imports = "all" + ignore = [ + "D200", # Require single line docstrings to be on one line. + "D203", # Require blank line before class docstring + "D212", # Multi-line docstring summary must start at the first line + "FIX002", # Forbid TODO in comments + "TD002", # Assign someone to 'TODO' comments - [tool.ruff.lint.per-file-ignores] - "test_*.py" = [ - "D103", # Require docstring in public function - "D104", # Require docstring in public package - "INP001", # Forbid implicit namespaces - "PLR2004", # Forbid magic values - "RUF018", # Forbid assignment in assertions - "S101", # Forbid assert statements - "TID252", # Require absolute imports + # The following are disabled for compatibility with the formatter + "COM812", # enforce trailing commas + "ISC001", # require imports to be sorted ] + [tool.ruff.lint.pyupgrade] + keep-runtime-typing = true + + [tool.ruff.lint.pydocstyle] + convention = "google" + + [tool.ruff.lint.isort] + known-first-party = ["pact", "pact_cli", "pact_ffi"] + + [tool.ruff.lint.flake8-tidy-imports] + ban-relative-imports = "all" + + [tool.ruff.lint.per-file-ignores] + "test_*.py" = [ + "D103", # Require docstring in public function + "D104", # Require docstring in public package + "INP001", # Forbid implicit namespaces + "PLR2004", # Forbid magic values + "RUF018", # Forbid assignment in assertions + "S101", # Forbid assert statements + "TID252", # Require absolute imports + ] + + [tool.ruff.format] + docstring-code-format = true + preview = true + + [tool.typos] + [tool.typos.default] + extend-ignore-re = [ + # Ignore spelling on a specific line + "(?Rm)^.*(#|//)\\s*spellchecker:disable-line$", + # Ignore spelling in a specific block + "(?s)(#|//)\\s*spellchecker:off.*?\\n\\s*(#|//)\\s*spellchecker:on", + ] - [tool.ruff.format] - docstring-code-format = true - preview = true - -################################################################################ -## Mypy Configuration -################################################################################ -[tool.mypy] -exclude = """(?x)^( - (src/pact|tests|examples)/v2/.*\\.pyi? -)$""" - -################################################################################ -## CI Build Wheel -################################################################################ -[tool.cibuildwheel] - -################################################################################ -## Typos -################################################################################ -[tool.typos] - - [tool.typos.default] - extend-ignore-re = [ - # Ignore spelling on a specific line - "(?Rm)^.*(#|//)\\s*spellchecker:disable-line$", - # Ignore spelling in a specific block - "(?s)(#|//)\\s*spellchecker:off.*?\\n\\s*(#|//)\\s*spellchecker:on", - ] - - [tool.typos.files] - extend-exclude = ["*.svg"] + [tool.typos.files] + extend-exclude = ["*.svg"] diff --git a/tests/.ruff.toml b/tests/.ruff.toml index 3558b7bba..ee08a6db7 100644 --- a/tests/.ruff.toml +++ b/tests/.ruff.toml @@ -1,16 +1,17 @@ #:schema https://www.schemastore.org/ruff.json + extend = "../pyproject.toml" # We have a number of helper files which contain assertions/magic values, etc. [lint] ignore = [ - "D102", # Require docstring in public methods - "D103", # Require docstring in public function - "D104", # Require docstring in public package + "D102", # Require docstring in public methods + "D103", # Require docstring in public function + "D104", # Require docstring in public package "INP001", # Forbid implicit namespaces - "PLR2004", # Forbid magic values + "PLR2004", # Forbid magic values "RUF018", # Forbid assignment in assertions - "S101", # Forbid assert statements + "S101", # Forbid assert statements "TID252", # Require absolute imports ]