Skip to content

Commit

Permalink
feat: add async support (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
Goldziher authored and stumpylog committed Jan 10, 2025
1 parent 4dc2160 commit 9ba645e
Show file tree
Hide file tree
Showing 19 changed files with 1,479 additions and 297 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,6 @@ virtualenv

# mac os
.DS_Store

# lock files
*.lock
28 changes: 23 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ repos:
hooks:
- id: check-docstring-first
- id: check-json
exclude: "tsconfig.*json"
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-toml
- id: check-executables-have-shebangs
Expand All @@ -26,7 +27,7 @@ repos:
- svg
- id: check-case-conflict
- id: detect-private-key
# See https://github.com/prettier/prettier/issues/15742 for the fork reason
# See https://github.com/prettier/prettier/issues/15742 for the fork reason
- repo: https://github.com/rbubley/mirrors-prettier
rev: "v3.4.2"
hooks:
Expand All @@ -39,15 +40,32 @@ repos:
rev: v2.3.0
hooks:
- id: codespell
exclude: ^tests
additional_dependencies:
- tomli
# Python hooks
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.8.2'
rev: v0.9.0
hooks:
# Run the linter.
- id: ruff
# Run the formatter.
args: [--fix]
- id: ruff-format
- repo: https://github.com/jsh9/pydoclint
rev: 0.5.15
hooks:
- id: pydoclint
args:
[
--style=google,
--check-return-types=False,
--arg-type-hints-in-docstring=False,
]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "v2.5.0"
hooks:
- id: pyproject-fmt
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.14.1'
hooks:
- id: mypy
additional_dependencies: ["httpx", "pytest"]
40 changes: 22 additions & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,25 @@ classifiers = [
"Programming Language :: Python :: Implementation :: PyPy",
]
dynamic = [ "version" ]

#
# Dependencies
#

dependencies = [
"anyio>=4.8",
"httpx>=0.27",
"typing-extensions; python_version<'3.11'",
]

urls.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"
urls.documentation = "https://github.com/stumpylog/tika-rest-client#readme"
urls.issues = "https://github.com/stumpylog/tika-rest-client/issues"
#
# 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"

urls.source = "https://github.com/stumpylog/tika-rest-client"

[tool.hatch.version]
path = "src/tika_client/__about__.py"
Expand Down Expand Up @@ -77,6 +83,7 @@ dependencies = [
"pytest-randomly ~= 3.15",
"pytest-rerunfailures ~= 15.0",
"pytest-xdist[psutil] ~= 3.6",
"pytest-asyncio ~= 0.25",
]
extra-dependencies = [
"pytest-sugar",
Expand Down Expand Up @@ -237,14 +244,14 @@ max_supported_python = "3.13"
[tool.pytest.ini_options]
minversion = "8.0"
testpaths = [ "tests" ]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "session"

[tool.coverage.run]
source_pkgs = [ "tika_client", "tests" ]
branch = true
parallel = true
omit = [
"src/tika_client/__about__.py",
]
omit = [ "src/tika_client/__about__.py" ]

[tool.coverage.paths]
tika_client = [ "src/tika_client", "*/tika-client/src/tika_client" ]
Expand All @@ -256,15 +263,12 @@ exclude_lines = [
"if __name__ == '__main__':",
"if TYPE_CHECKING:",
]
fail_under = 80 # adjust this as required, for libraries i prefer 100 or there about

[tool.mypy]
#disallow_any_expr = true
#disallow_untyped_defs = true
#disallow_incomplete_defs = true
check_untyped_defs = true
strict_optional = true

warn_redundant_casts = true
warn_unused_ignores = true
warn_unreachable = true
warn_unused_configs = true
packages = [ "tika_client", "tests" ]
python_version = "3.9"
disable_error_code = 'import-untyped'
implicit_reexport = false
show_error_codes = true
strict = true
3 changes: 2 additions & 1 deletion src/tika_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
#
# SPDX-License-Identifier: MPL-2.0

from tika_client.client import AsyncTikaClient
from tika_client.client import TikaClient
from tika_client.data_models import DublinCoreKey
from tika_client.data_models import TikaKey
from tika_client.data_models import XmpKey

__all__ = ["DublinCoreKey", "TikaClient", "TikaKey", "XmpKey"]
__all__ = ["AsyncTikaClient", "DublinCoreKey", "TikaClient", "TikaKey", "XmpKey"]
Loading

0 comments on commit 9ba645e

Please sign in to comment.