From ba9bb300a9717454eaf8ccade61054eba4fef725 Mon Sep 17 00:00:00 2001 From: Trenton Holmes <797416+stumpylog@users.noreply.github.com> Date: Thu, 13 Jun 2024 13:36:45 -0700 Subject: [PATCH] Adds mypy typing to CI --- .github/FUNDING.yml | 3 +++ .github/workflows/ci.yml | 4 ++++ .pre-commit-config.yaml | 5 ++--- CHANGELOG.md | 1 + pyproject.toml | 15 +++++++++------ 5 files changed, 19 insertions(+), 9 deletions(-) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..c878a0c --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,3 @@ +# These are supported funding model platforms + +github: stumpylog diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 43edb6d..f31c701 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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/action@v3.0.1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1646298..07d1065 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index a5ca743..69a893d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 4946cc5..3fa4443 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = "rda0128ou@mozmail.com" }, ] @@ -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'", @@ -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 @@ -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] @@ -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", @@ -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 = [ @@ -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] @@ -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:", ]