Skip to content
Open
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
22 changes: 11 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ repos:
- id: check-hooks-apply

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # frozen: v5.0.0
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
hooks:
- id: check-merge-conflict
- id: check-case-conflict
Expand All @@ -39,24 +39,24 @@ repos:
args: [--pytest-test-first]

- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: a6273196190bb0f68caf1dc68073cf62c719f725 # frozen: v2.14.0
rev: 4380fbb73a154b5f5624794c1c78d9719ccc860f # frozen: v2.16.0
hooks:
- id: pretty-format-yaml
args: [--autofix, --indent, '2']

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 06e4cc849d03f3a59ca223a4046f4bb5bb2aba6d # frozen: 0.33.0
rev: 943377262562a12b57292fc98fabd7dbf81451fe # frozen: 0.37.2
hooks:
- id: check-dependabot
- id: check-github-workflows

- repo: https://github.com/tox-dev/pyproject-fmt
rev: 57b6ff7bf72affdd12c7f3fd6de761ba18a33b3a # frozen: v2.5.1
rev: 91de51aef61c5f2383f03da25604e3d65a8309e0 # frozen: v2.21.1
hooks:
- id: pyproject-fmt

- repo: https://github.com/executablebooks/mdformat
rev: ff29be1a1ba8029d9375882aa2c812b62112a593 # frozen: 0.7.22
rev: 2d496dbc18e31b83a1596685347ffe0b6041daf0 # frozen: 1.0.0
hooks:
- id: mdformat
args: [--number, --wrap=120, --ignore-missing-references]
Expand All @@ -73,21 +73,21 @@ repos:
- mdformat-mkdocs[recommended]>=v2.0.7

- repo: https://github.com/provinzkraut/unasyncd
rev: 572842a04440d45bd7d6bee5a6a4d006891d8c66 # frozen: v0.8.1
rev: 0277a2b647c5564dc87ff093f6e8f142094371ce # frozen: v0.10.0
hooks:
- id: unasyncd
additional_dependencies:
- ruff==0.6.1

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: e84319e627902e1b348574ecf3238dc511933dc7 # frozen: v0.11.7
rev: 6fec9b7edb08fd9989088709d864a7826dc74e80 # frozen: v0.15.12
hooks:
- id: ruff
args: [--fix, --show-fixes, --exit-non-zero-on-fix]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: f40886d54c729f533f864ed6ce584e920feb0af7 # frozen: v1.15.0
rev: fc0f09a29bb495f4a91f00266155d6282d52485d # frozen: v1.20.2
hooks:
- id: mypy
args: [--config-file=pyproject.toml]
Expand All @@ -101,12 +101,12 @@ repos:
- xsdata>=24.5

- repo: https://github.com/scientific-python/cookie
rev: f801700e5a8beb2f42e63d752d7116aa4dbaa0f1 # frozen: 2025.01.22
rev: 04d0e44c1d3b036e9714aca375d965504ba5ea4a # frozen: 2026.04.04
hooks:
- id: sp-repo-review

- repo: https://github.com/crate-ci/typos
rev: 15ff058881549e16b0edb975a9b0b0d0cccd612c # frozen: v1
rev: a90d2a917d59472bef788897931c1a5a5d12870a # frozen: v1
hooks:
- id: typos
args: [--force-exclude]
Expand All @@ -118,7 +118,7 @@ repos:
- id: licensecheck

- repo: https://github.com/compilerla/conventional-pre-commit
rev: fa1915d04e129bcd0dccabf6aca53cdc19787ab4 # frozen: v4.1.0
rev: 3db014c16a9d31997ab8c07a4d61fcce936c8f0d # frozen: v4.4.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
Expand Down
143 changes: 68 additions & 75 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# hatch
# Ref: https://hatch.pypa.io/latest/config/metadata/
# ------------------------------------------------------------------------------

[build-system]
build-backend = "hatchling.build"
requires = [
Expand Down Expand Up @@ -36,6 +35,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Text Processing :: Markup :: XML",
"Typing :: Typed",
Expand Down Expand Up @@ -83,22 +83,23 @@ docs = [
"mkdocstrings[python]",
]

[tool.hatch.build.targets.sdist]
only-include = [
[tool.hatch]
build.targets.sdist.only-include = [
"src/re3data",
]
exclude = [
build.targets.sdist.exclude = [
"src/re3data/_resources/*.md",
"src/re3data/_resources/*.xml",
]

[tool.hatch.build.targets.wheel]
only-packages = true
packages = [
build.targets.wheel.only-packages = true
build.targets.wheel.packages = [
"src/re3data",
]

[tool.ruff] # Ref: https://docs.astral.sh/ruff/configuration/
[tool.uv]
default-groups = [ "dev", "test" ]

[tool.ruff] # Ref: https://docs.astral.sh/ruff/configuration/
line-length = 120
src = [
"src",
Expand Down Expand Up @@ -151,7 +152,7 @@ lint.isort.known-first-party = [
]
lint.pydocstyle.convention = "google"

[tool.repo-review] # Ref: https://github.com/scientific-python/cookie/tree/main#list-of-checks
[tool.repo-review] # Ref: https://github.com/scientific-python/cookie/tree/main#list-of-checks
ignore = [
# PC is Pre-commit
"PC111", # blacken-docs
Expand All @@ -162,107 +163,99 @@ ignore = [
"RTD", # read the docs
]

[tool.pytest.ini_options] # Ref: https://docs.pytest.org/en/stable/customize.html
minversion = "8.0"
addopts = [
[tool.typos] # Ref: https://github.com/crate-ci/typos/blob/master/docs/reference.md
# add "spellchecker:disable-line" to ignore specific lines
default.extend-ignore-re = [
"(?Rm)^.*# spellchecker:disable-line$",
]

[tool.mypy] # Ref: https://mypy.readthedocs.io/en/stable/config_file.html#using-a-pyproject-toml-file
python_version = "3.10"
strict = true
pretty = true
show_column_numbers = true
show_error_context = true
enable_error_code = [
"ignore-without-code",
"redundant-expr",
"truthy-bool",
]
warn_unreachable = true

[tool.pytest]
# Ref: https://docs.pytest.org/en/stable/customize.html
ini_options.minversion = "8.0"
ini_options.addopts = [
"-ra",
"--showlocals",
"--strict-markers",
"--strict-config",
"-m not e2e", # default behaviour: do not run e2e tests
]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
filterwarnings = [
ini_options.asyncio_mode = "auto"
ini_options.asyncio_default_fixture_loop_scope = "function"
ini_options.filterwarnings = [
"error",
]
log_cli_level = "INFO"
xfail_strict = true
testpaths = "tests"
markers = [
ini_options.log_cli_level = "INFO"
ini_options.xfail_strict = true
ini_options.testpaths = "tests"
ini_options.markers = [
"e2e: marks tests as end-to-end tests, requesting the live api",
]

[tool.coverage.run] # Ref: https://coverage.readthedocs.io/en/latest/config.html
branch = true
parallel = true
source = [
"re3data",
]
omit = [
[tool.coverage]
# Ref: https://coverage.readthedocs.io/en/latest/config.html
run.branch = true
run.omit = [
"__main__.py",
]

[tool.coverage.report]
exclude_also = [
"if TYPE_CHECKING:",
"@overload",
run.parallel = true
run.source = [
"re3data",
]
fail_under = 90
show_missing = true
skip_covered = true
skip_empty = true

[tool.mypy] # Ref: https://mypy.readthedocs.io/en/stable/config_file.html#using-a-pyproject-toml-file
python_version = "3.10"
strict = true
pretty = true
show_column_numbers = true
show_error_context = true
enable_error_code = [
"ignore-without-code",
"redundant-expr",
"truthy-bool",
report.exclude_also = [
"@overload",
"if TYPE_CHECKING:",
]
warn_unreachable = true

[tool.uv]
default-groups = [ "dev", "test" ]
report.fail_under = 90
report.show_missing = true
report.skip_covered = true
report.skip_empty = true

[tool.licensecheck] # Ref: https://github.com/FHPythonUtils/LicenseCheck/#example-1-pyprojecttoml
[tool.licensecheck] # Ref: https://github.com/FHPythonUtils/LicenseCheck/#example-1-pyprojecttoml
using = "PEP631"
format = "ansi"

[tool.unasyncd] # Ref: https://github.com/provinzkraut/unasyncd?tab=readme-ov-file#configuration
[tool.unasyncd] # Ref: https://github.com/provinzkraut/unasyncd?tab=readme-ov-file#configuration
add_editors_note = true
ruff_fix = true
ruff_format = true
transform_docstrings = true
add_replacements.AsyncClient = "Client"
add_replacements."re3data.AsyncClient" = "re3data.Client"
add_replacements.async_client = "client"
add_replacements.async_log_response = "log_response"
add_replacements."httpx.AsyncClient" = "httpx.Client"
add_replacements.AsyncRepositoryManager = "RepositoryManager"
files."src/re3data/_client/_async.py" = "src/re3data/_client/_sync.py"
files."tests/integration/test_async_client.py" = "tests/integration/test_client.py"

[tool.unasyncd.files]
"src/re3data/_client/_async.py" = "src/re3data/_client/_sync.py"
"tests/integration/test_async_client.py" = "tests/integration/test_client.py"

[tool.unasyncd.add_replacements]
"AsyncClient" = "Client"
"re3data.AsyncClient" = "re3data.Client"
"async_client" = "client"
"async_log_response" = "log_response"
"httpx.AsyncClient" = "httpx.Client"
"AsyncRepositoryManager" = "RepositoryManager"

[tool.semantic_release] # Ref: https://python-semantic-release.readthedocs.io/en/latest/configuration.html#settings
[tool.semantic_release] # Ref: https://python-semantic-release.readthedocs.io/en/latest/configuration.html#settings
commit_author = "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>"
commit_message = "chore: release {version}\n\nAutomatically generated by python-semantic-release [skip ci]"
major_on_zero = false
tag_format = "{version}"
version_toml = [
"pyproject.toml:project.version",
]
build_command = '''
sed -i "s/^version: .*/version: $NEW_VERSION/" CITATION.cff
build_command = """sed -i "s/^version: .*/version: $NEW_VERSION/" CITATION.cff
sed -i "s/^date-released: .*/date-released: $(date "+%Y-%m-%d")/" CITATION.cff
sed -i "s|/compare/[0-9]*\.[0-9]*\.[0-9]*...main|/compare/$NEW_VERSION...main|" CHANGELOG.md
git add CHANGELOG.md CITATION.cff
'''
"""
changelog.mode = "update"
changelog.insertion_flag = "<!-- releases -->"
changelog.template_dir = ".github/templates"
changelog.exclude_commit_patterns = [ "^build", "^chore", "^style", "^ci" ]
changelog.environment.keep_trailing_newline = false

[tool.typos] # Ref: https://github.com/crate-ci/typos/blob/master/docs/reference.md
# add "spellchecker:disable-line" to ignore specific lines
default.extend-ignore-re = [
"(?Rm)^.*# spellchecker:disable-line$",
]
Loading