Skip to content

Commit 04032c5

Browse files
committed
chore: replace taplo with tombi
The maintainer for taplo has gone on an indefinite break, so switching to tombi for TOML formatting and linting. This is also an opportunity to implement a few changes to the hatch config: - pypa/hatch#1852 - pypa/hatch#1639 Signed-off-by: JP-Ellis <josh@jpellis.me>
1 parent 3e6a602 commit 04032c5

16 files changed

Lines changed: 518 additions & 616 deletions

File tree

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ repos:
7474
mascot\.svg
7575
)$
7676
77+
- repo: https://github.com/tombi-toml/tombi-pre-commit
78+
rev: v0.9.3
79+
hooks:
80+
- id: tombi-format
81+
- id: tombi-lint
82+
7783
- repo: local
7884
hooks:
7985
# Mypy is difficult to run pre-commit's isolated environment as it needs

.taplo.toml

Lines changed: 0 additions & 10 deletions
This file was deleted.

.tombi.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
toml-version = "v1.1.0"
2+
3+
[format]
4+
[format.rules]
5+
indent-sub-tables = true

.vscode/extensions.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"ms-python.mypy-type-checker",
1212
"ms-python.python",
1313
"redhat.vscode-yaml",
14-
"tamasfe.even-better-toml",
15-
"yzhang.markdown-all-in-one"
14+
"yzhang.markdown-all-in-one",
15+
"tombi-toml.tombi"
1616
]
1717
}

committed.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
## Configuration for committed
33
##
44
## See <https://github.com/crate-ci/committed/blob/master/docs/reference.md>
5+
56
style = "conventional"
67

7-
line_length = 80
8-
merge_commit = false
9-
no_fixup = false
8+
line_length = 80
9+
merge_commit = false
10+
no_fixup = false
1011
subject_capitalized = false
1112

1213
allowed_types = [

docs/scripts/.ruff.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#:schema https://www.schemastore.org/ruff.json
2+
23
extend = "../../pyproject.toml"
34

45
[lint]
56
ignore = [
6-
"INP001", # Forbid implicit namespaces
7+
"INP001", # Forbid implicit namespaces
78
]

examples/catalog/pyproject.toml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#:schema https://www.schemastore.org/pyproject.toml
2+
23
[project]
3-
name = "pact-python-catalog"
4+
name = "pact-python-catalog"
45
version = "1.0.0"
56

67
dependencies = [
@@ -15,15 +16,16 @@ requires-python = ">=3.10"
1516
[dependency-groups]
1617
test = ["pact-python", "pytest~=9.0", "uvicorn~=0.30"]
1718

18-
[tool.uv.sources]
19-
pact-python = { path = "../../" }
19+
[tool]
20+
[tool.uv.sources]
21+
pact-python = { path = "../../" }
2022

21-
[tool.ruff]
22-
extend = "../../pyproject.toml"
23+
[tool.ruff]
24+
extend = "../../pyproject.toml"
2325

24-
[tool.pytest]
25-
addopts = ["--import-mode=importlib"]
26+
[tool.pytest]
27+
addopts = ["--import-mode=importlib"]
2628

27-
log_date_format = "%H:%M:%S"
28-
log_format = "%(asctime)s.%(msecs)03d [%(levelname)-8s] %(name)s: %(message)s"
29-
log_level = "NOTSET"
29+
log_date_format = "%H:%M:%S"
30+
log_format = "%(asctime)s.%(msecs)03d [%(levelname)-8s] %(name)s: %(message)s"
31+
log_level = "NOTSET"
Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
11
#:schema https://www.schemastore.org/pyproject.json
2+
23
[project]
34
name = "example-aiohttp-and-flask"
45

56
description = "Example of using an aiohttp client and Flask server with Pact Python"
67

7-
dependencies = ["aiohttp~=3.0", "flask~=3.0", "typing-extensions~=4.0"]
8+
version = "1.0.0"
89
requires-python = ">=3.10"
9-
version = "1.0.0"
10+
dependencies = ["aiohttp~=3.0", "flask~=3.0", "typing-extensions~=4.0"]
1011

1112
[dependency-groups]
12-
test = ["pact-python", "pytest-asyncio~=1.0", "pytest~=9.0"]
13+
test = ["pact-python", "pytest~=9.0", "pytest-asyncio~=1.0"]
1314

14-
[tool.uv.sources]
15-
pact-python = { path = "../../../" }
15+
[tool]
16+
[tool.pytest]
17+
addopts = ["--import-mode=importlib"]
1618

17-
[tool.ruff]
18-
extend = "../../../pyproject.toml"
19+
asyncio_default_fixture_loop_scope = "session"
1920

20-
[tool.pytest]
21-
addopts = ["--import-mode=importlib"]
21+
log_date_format = "%H:%M:%S"
22+
log_format = "%(asctime)s.%(msecs)03d [%(levelname)-8s] %(name)s: %(message)s"
23+
log_level = "NOTSET"
2224

23-
asyncio_default_fixture_loop_scope = "session"
25+
[tool.ruff]
26+
extend = "../../../pyproject.toml"
2427

25-
log_date_format = "%H:%M:%S"
26-
log_format = "%(asctime)s.%(msecs)03d [%(levelname)-8s] %(name)s: %(message)s"
27-
log_level = "NOTSET"
28+
[tool.uv.sources]
29+
pact-python = { path = "../../../" }
Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
11
#:schema https://www.schemastore.org/pyproject.json
2+
23
[project]
34
name = "example-requests-and-fastapi"
45

56
description = "Example of using a requests client and FastAPI server with Pact Python"
67

7-
dependencies = ["requests~=2.0", "fastapi~=0.0", "typing-extensions~=4.0"]
8+
version = "1.0.0"
89
requires-python = ">=3.10"
9-
version = "1.0.0"
10+
dependencies = ["fastapi~=0.0", "requests~=2.0", "typing-extensions~=4.0"]
1011

1112
[dependency-groups]
12-
1313
test = ["pact-python", "pytest~=9.0", "uvicorn~=0.29"]
1414

15-
[tool.uv.sources]
16-
pact-python = { path = "../../../" }
15+
[tool]
16+
[tool.pytest]
17+
addopts = ["--import-mode=importlib"]
1718

18-
[tool.ruff]
19-
extend = "../../../pyproject.toml"
19+
asyncio_default_fixture_loop_scope = "session"
2020

21-
[tool.pytest]
22-
addopts = ["--import-mode=importlib"]
21+
log_date_format = "%H:%M:%S"
22+
log_format = "%(asctime)s.%(msecs)03d [%(levelname)-8s] %(name)s: %(message)s"
23+
log_level = "NOTSET"
2324

24-
asyncio_default_fixture_loop_scope = "session"
25+
[tool.ruff]
26+
extend = "../../../pyproject.toml"
2527

26-
log_date_format = "%H:%M:%S"
27-
log_format = "%(asctime)s.%(msecs)03d [%(levelname)-8s] %(name)s: %(message)s"
28-
log_level = "NOTSET"
28+
[tool.uv.sources]
29+
pact-python = { path = "../../../" }
Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
#:schema https://www.schemastore.org/pyproject.json
2+
23
[project]
34
name = "example-service-consumer-provider"
45

56
description = "Example of a service acting as both a Pact consumer and provider"
67

7-
dependencies = ["fastapi~=0.0", "requests~=2.0", "typing-extensions~=4.0"]
8+
version = "1.0.0"
89
requires-python = ">=3.10"
9-
version = "1.0.0"
10+
dependencies = ["fastapi~=0.0", "requests~=2.0", "typing-extensions~=4.0"]
1011

1112
[dependency-groups]
12-
1313
test = ["pact-python", "pytest~=9.0", "uvicorn~=0.29"]
1414

15-
[tool.uv.sources]
16-
pact-python = { path = "../../../" }
15+
[tool]
16+
[tool.pytest]
17+
addopts = ["--import-mode=importlib"]
1718

18-
[tool.ruff]
19-
extend = "../../../pyproject.toml"
19+
log_date_format = "%H:%M:%S"
20+
log_format = "%(asctime)s.%(msecs)03d [%(levelname)-8s] %(name)s: %(message)s"
21+
log_level = "NOTSET"
2022

21-
[tool.pytest]
22-
addopts = ["--import-mode=importlib"]
23+
[tool.ruff]
24+
extend = "../../../pyproject.toml"
2325

24-
log_date_format = "%H:%M:%S"
25-
log_format = "%(asctime)s.%(msecs)03d [%(levelname)-8s] %(name)s: %(message)s"
26-
log_level = "NOTSET"
26+
[tool.uv.sources]
27+
pact-python = { path = "../../../" }

0 commit comments

Comments
 (0)