Skip to content

Commit

Permalink
Adds mypy typing to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
stumpylog committed Jun 13, 2024
1 parent d862841 commit ba9bb30
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

github: stumpylog
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ jobs:
name: Lint project
run: |
hatch fmt --check
-
name: Check project typing
run: |
hatch run typing:run
-
name: Check files with pre-commit
uses: pre-commit/[email protected]
Expand Down
5 changes: 2 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,16 @@ repos:
- id: check-case-conflict
- id: detect-private-key
- repo: https://github.com/pre-commit/mirrors-prettier
rev: 'v3.0.3'
rev: 'v3.1.0'
hooks:
- id: prettier
types_or:
- javascript
- ts
- markdown
exclude: "(^Pipfile\\.lock$)"
# Python hooks
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.4.2'
rev: 'v0.4.8'
hooks:
# Run the linter.
- id: ruff
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Updated development tools
- Bump pypa/gh-action-pypi-publish from 1.8.12 to 1.8.14 (by [@dependabot](https://github.com/apps/dependabot) in [#16](https://github.com/stumpylog/tika-client/pull/16))
- Update development to use `hatch test` and `hatch fmt` ([#17](https://github.com/stumpylog/tika-client/pull/17))
- Included `mypy` typing in the linting checks

## [0.5.0] - 2023-11-07

Expand Down
15 changes: 9 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ description = "A modern REST client for Apache Tika server"
readme = "README.md"
requires-python = ">=3.8"
license = "MPL-2.0"
keywords = []
keywords = ["api", "pdf", "html", "client", "office", "tika"]
authors = [
{ name = "Trenton H", email = "[email protected]" },
]
Expand All @@ -31,7 +31,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy"
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"httpx ~= 0.27; python_version >= '3.9'",
Expand All @@ -43,6 +43,7 @@ dependencies = [
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"

#
# Hatch Configuration
Expand All @@ -61,7 +62,7 @@ installer = "uv"

[tool.hatch.envs.hatch-static-analysis]
# https://hatch.pypa.io/latest/config/internal/static-analysis/
dependencies = ["ruff ~= 0.4.2"]
dependencies = ["ruff ~= 0.4.8"]
config-path = "none"

[tool.hatch.envs.hatch-test]
Expand All @@ -72,7 +73,7 @@ dependencies = [
"coverage-enable-subprocess == 1.0",
"coverage[toml] ~= 7.4",
"pytest < 8.0; python_version < '3.9'",
"pytest ~= 8.1; python_version >= '3.9'",
"pytest ~= 8.2; python_version >= '3.9'",
"pytest-mock ~= 3.12",
"pytest-randomly ~= 3.15",
"pytest-rerunfailures ~= 14.0",
Expand All @@ -84,7 +85,7 @@ extra-dependencies = [
"pytest-httpx ~= 0.22; python_version < '3.9'",
"python-magic",
]
extra-args = ["--maxprocesses=8"]
extra-args = ["--maxprocesses=8", "--pythonwarnings=all"]

[tool.hatch.envs.hatch-test.scripts]
run = [
Expand Down Expand Up @@ -203,6 +204,8 @@ ignore = [
"S105", "S106", "S107",
# Ignore complexity
"C901", "PLR0911", "PLR0912", "PLR0913", "PLR0915",
# Ignore no author and missing issue link in TODO tags
"TD002", "TD003"
]

[tool.ruff.lint.isort]
Expand Down Expand Up @@ -237,7 +240,7 @@ tests = ["tests", "*/tika-client/tests"]
[tool.coverage.report]
exclude_lines = [
"no cov",
"if __name__ == .__main__.:",
"if __name__ == '__main__':",
"if TYPE_CHECKING:",
]

Expand Down

0 comments on commit ba9bb30

Please sign in to comment.