-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrades dependencies and hook versions
- Loading branch information
Trenton Holmes
committed
Oct 8, 2024
1 parent
8e01528
commit 48322a1
Showing
3 changed files
with
87 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
# | ||
# Project Configuration | ||
# | ||
|
||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
requires = [ "hatchling" ] | ||
|
||
[project] | ||
name = "tika-client" | ||
dynamic = ["version"] | ||
description = "A modern REST client for Apache Tika server" | ||
readme = "README.md" | ||
requires-python = ">=3.8" | ||
keywords = [ "api", "client", "html", "office", "pdf", "tika" ] | ||
license = "MPL-2.0" | ||
keywords = ["api", "pdf", "html", "client", "office", "tika"] | ||
authors = [ | ||
{ name = "Trenton H", email = "[email protected]" }, | ||
] | ||
requires-python = ">=3.8" | ||
classifiers = [ | ||
"Development Status :: 4 - Beta", | ||
"Environment :: Web Environment", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)", | ||
"Operating System :: OS Independent", | ||
"Intended Audience :: Developers", | ||
"Environment :: Web Environment", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
|
@@ -33,36 +33,37 @@ classifiers = [ | |
"Programming Language :: Python :: Implementation :: CPython", | ||
"Programming Language :: Python :: Implementation :: PyPy", | ||
] | ||
dynamic = [ "version" ] | ||
dependencies = [ | ||
"httpx ~= 0.27; python_version >= '3.9'", | ||
"httpx ~= 0.24; python_version < '3.9'", | ||
"typing-extensions; python_version < '3.11'" | ||
"httpx~=0.24; python_version<'3.9'", | ||
"httpx~=0.27; python_version>='3.9'", | ||
"typing-extensions; python_version<'3.11'", | ||
] | ||
|
||
[project.urls] | ||
Documentation = "https://github.com/stumpylog/tika-rest-client#readme" | ||
Issues = "https://github.com/stumpylog/tika-rest-client/issues" | ||
Source = "https://github.com/stumpylog/tika-rest-client" | ||
Changelog = "https://github.com/stumpylog/tika-rest-client/blob/main/CHANGELOG.md" | ||
urls.Changelog = "https://github.com/stumpylog/tika-rest-client/blob/main/CHANGELOG.md" | ||
|
||
# | ||
# Hatch Configuration | ||
# | ||
urls.Documentation = "https://github.com/stumpylog/tika-rest-client#readme" | ||
urls.Issues = "https://github.com/stumpylog/tika-rest-client/issues" | ||
urls.Source = "https://github.com/stumpylog/tika-rest-client" | ||
|
||
[tool.hatch.version] | ||
path = "src/tika_client/__about__.py" | ||
|
||
[tool.hatch.build.targets.sdist] | ||
exclude = [ | ||
".github", | ||
".docker" | ||
".docker", | ||
] | ||
|
||
[tool.hatch.envs.default] | ||
installer = "uv" | ||
|
||
[tool.hatch.envs.hatch-static-analysis] | ||
# https://hatch.pypa.io/latest/config/internal/static-analysis/ | ||
dependencies = ["ruff ~= 0.5.6"] | ||
dependencies = [ "ruff ~= 0.6" ] | ||
config-path = "none" | ||
|
||
[tool.hatch.envs.hatch-test] | ||
|
@@ -81,72 +82,74 @@ dependencies = [ | |
] | ||
extra-dependencies = [ | ||
"pytest-sugar", | ||
"pytest-httpx ~= 0.30; python_version >= '3.9'", | ||
"pytest-httpx == 0.30.0; python_version >= '3.9'", | ||
"pytest-httpx ~= 0.22; python_version < '3.9'", | ||
"python-magic", | ||
] | ||
extra-args = ["--maxprocesses=8", "--pythonwarnings=all"] | ||
extra-args = [ "--maxprocesses=8", "--pythonwarnings=all" ] | ||
|
||
[tool.hatch.envs.hatch-test.scripts] | ||
run = [ | ||
"python3 --version", | ||
"pytest{env:HATCH_TEST_ARGS:} {args}"] | ||
"pytest{env:HATCH_TEST_ARGS:} {args}", | ||
] | ||
|
||
run-cov = [ | ||
"python3 --version", | ||
"coverage erase", | ||
"coverage run -m pytest{env:HATCH_TEST_ARGS:} {args}" | ||
"coverage run -m pytest{env:HATCH_TEST_ARGS:} {args}", | ||
] | ||
cov-combine = ["coverage combine"] | ||
cov-combine = [ "coverage combine" ] | ||
cov-report = [ | ||
"coverage report", | ||
"coverage json", | ||
"coverage html" | ||
"coverage html", | ||
] | ||
|
||
[[tool.hatch.envs.hatch-test.matrix]] | ||
python = ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.8", "pypy3.9", "pypy3.10"] | ||
python = [ "3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.8", "pypy3.9", "pypy3.10" ] | ||
|
||
# | ||
# Custom Environments | ||
# | ||
[tool.hatch.envs.typing] | ||
detached = true | ||
dependencies = [ | ||
"mypy ~= 1.11.0", | ||
"mypy ~= 1.11", | ||
"httpx", | ||
] | ||
|
||
[tool.hatch.envs.typing.scripts] | ||
run = [ | ||
"mypy --version", | ||
"mypy --install-types --non-interactive {args:src/tika_client}" | ||
"mypy --install-types --non-interactive {args:src/tika_client}", | ||
] | ||
|
||
[tool.hatch.envs.pre-commit] | ||
template = "pre-commit" | ||
detached = true | ||
dependencies = [ | ||
"pre-commit ~= 3.8.0", | ||
"pre-commit ~= 4.0", | ||
"pre-commit-uv", | ||
] | ||
|
||
[tool.hatch.envs.pre-commit.scripts] | ||
check = ["pre-commit run --all-files"] | ||
update = ["pre-commit autoupdate"] | ||
check = [ "pre-commit run --all-files" ] | ||
update = [ "pre-commit autoupdate" ] | ||
|
||
# | ||
# Tool Configuration | ||
# | ||
|
||
[tool.ruff] | ||
# https://docs.astral.sh/ruff/settings/ | ||
fix = true | ||
output-format = "grouped" | ||
target-version = "py38" | ||
line-length = 120 | ||
|
||
[tool.ruff.lint] | ||
# https://docs.astral.sh/ruff/settings/ | ||
fix = true | ||
output-format = "grouped" | ||
# https://docs.astral.sh/ruff/rules/ | ||
extend-select = [ | ||
lint.extend-select = [ | ||
"A", | ||
"ARG", | ||
"B", | ||
|
@@ -169,15 +172,15 @@ extend-select = [ | |
"ISC", | ||
"N", | ||
"PERF", | ||
"PIE", | ||
"PGH", | ||
"PTH", | ||
"PIE", | ||
"PL", | ||
"PLC", | ||
"PLE", | ||
"PLR", | ||
"PLW", | ||
"PT", | ||
"PTH", | ||
"Q", | ||
"RSE", | ||
"RUF", | ||
|
@@ -195,47 +198,56 @@ extend-select = [ | |
"W", | ||
"YTT", | ||
] | ||
ignore = [ | ||
lint.ignore = [ | ||
# Allow non-abstract empty methods in abstract base classes | ||
"B027", | ||
# Ignore complexity | ||
"C901", | ||
# Allow boolean positional values in function calls, like `dict.get(... True)` | ||
"FBT003", | ||
"PLR0911", | ||
"PLR0912", | ||
"PLR0913", | ||
"PLR0915", | ||
# Ignore checks for possible passwords | ||
"S105", "S106", "S107", | ||
# Ignore complexity | ||
"C901", "PLR0911", "PLR0912", "PLR0913", "PLR0915", | ||
"S105", | ||
"S106", | ||
"S107", | ||
# Ignore no author and missing issue link in TODO tags | ||
"TD002", "TD003" | ||
"TD002", | ||
"TD003", | ||
] | ||
|
||
[tool.ruff.lint.isort] | ||
force-single-line = true | ||
known-first-party = ["tika_client"] | ||
|
||
[tool.ruff.lint.flake8-tidy-imports] | ||
ban-relative-imports = "all" | ||
|
||
[tool.ruff.lint.per-file-ignores] | ||
# Tests can use magic values, assertions, and relative imports | ||
"tests/**/*" = ["PLR2004", | ||
"S101", | ||
"TID252", | ||
# Allow more complex pytest.raises | ||
"PT012", | ||
"DTZ001" | ||
] | ||
lint.per-file-ignores."tests/**/*" = [ | ||
"DTZ001", | ||
"PLR2004", | ||
# Allow more complex pytest.raises | ||
"PT012", | ||
"S101", | ||
"TID252", | ||
] | ||
# No relative imports | ||
lint.flake8-tidy-imports.ban-relative-imports = "all" | ||
# One import per line | ||
lint.isort.force-single-line = true | ||
# Recognize us please | ||
lint.isort.known-first-party = [ "tika_client" ] | ||
|
||
[tool.pytest.ini_options] | ||
minversion = "7.0" | ||
testpaths = [ "tests" ] | ||
|
||
[tool.coverage.run] | ||
source_pkgs = ["tika_client", "tests"] | ||
source_pkgs = [ "tika_client", "tests" ] | ||
branch = true | ||
parallel = true | ||
omit = [ | ||
"src/tika_client/__about__.py", | ||
] | ||
|
||
[tool.coverage.paths] | ||
tika_client = ["src/tika_client", "*/tika-client/src/tika_client"] | ||
tests = ["tests", "*/tika-client/tests"] | ||
tika_client = [ "src/tika_client", "*/tika-client/src/tika_client" ] | ||
tests = [ "tests", "*/tika-client/tests" ] | ||
|
||
[tool.coverage.report] | ||
exclude_lines = [ | ||
|
@@ -255,6 +267,3 @@ warn_redundant_casts = true | |
warn_unused_ignores = true | ||
warn_unreachable = true | ||
warn_unused_configs = true | ||
|
||
[tool.pytest.ini_options] | ||
minversion = "7.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters