Skip to content

Commit

Permalink
Fixes from the project generation and the addition of pre-commit hatc…
Browse files Browse the repository at this point in the history
…h scripts
  • Loading branch information
stumpylog committed Oct 10, 2023
1 parent 2615219 commit e860720
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 15 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,23 @@
pip install gotenberg-client
```

## What

This is a Python client for interfacing with [Gotenberg](https://gotenberg.dev/), which in turn is a wrapper around
powerful tools for PDF generation and creation in various ways.

## Why

As far as I can tell, no Python library exists to interface with the Gotenberg API.

### Features

- HTTP/2 enabled by default
- Abstract away the handling of multi-part/form-data and deal with files instead
- Based on the modern [httpx](https://github.com/encode/httpx) library
- Full support for type hinting and concrete return types as mush as possible
- Nearly full test coverage run against an actual Gotenberg server for multiple Python and PyPy versions

## License

`gotenberg-client` is distributed under the terms of the [MPL 2.0](https://spdx.org/licenses/MPL-2.0.html) license.
32 changes: 17 additions & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@ Issues = "https://github.com/stumpylog/gotenberg-client/issues"
Source = "https://github.com/stumpylog/gotenberg-client/"
Changelog = "https://github.com/stumpylog/gotenberg-client/blob/main/CHANGELOG.md"

[project.optional-dependencies]
compression = ["httpx[http2,brotli] ~= 0.24"]

[tool.hatch.version]
path = "src/_/__about__.py"
path = "src/gotenberg_client/__about__.py"

[tool.hatch.build.targets.sdist]
exclude = [
Expand Down Expand Up @@ -75,7 +78,7 @@ cov = [
pip-list = "pip list"

[[tool.hatch.envs.all.matrix]]
python = ["3.8", "3.9", "3.10", "3.11"]
python = ["3.8", "3.9", "3.10", "3.11", "3.12"]

[tool.hatch.envs.pre-commit]
dependencies = [
Expand All @@ -86,18 +89,17 @@ dependencies = [
check = ["pre-commit run --all-files"]
update = ["pre-commit autoupdate"]


[tool.hatch.envs.lint]
detached = true
dependencies = [
"black>=23.1.0",
"black>=23.9.1",
"mypy>=1.0.0",
"ruff>=0.0.243",
"ruff>=0.0.292",
"httpx",
]

[tool.hatch.envs.lint.scripts]
typing = "mypy --install-types --non-interactive {args:src/_ tests}"
typing = "mypy --install-types --non-interactive {args:src/gotenberg_client tests}"
style = [
"ruff {args:.}",
"black --check --diff {args:.}",
Expand All @@ -113,12 +115,12 @@ all = [
]

[tool.black]
target-version = ["py37"]
target-version = ["py38"]
line-length = 120
skip-string-normalization = true

[tool.ruff]
target-version = "py37"
target-version = "py38"
line-length = 120
extend-select = [
"A",
Expand Down Expand Up @@ -182,16 +184,16 @@ ban-relative-imports = "all"
"tests/**/*" = ["PLR2004", "S101", "TID252"]

[tool.coverage.run]
source_pkgs = ["gotenberg-client", "tests"]
source_pkgs = ["gotenberg_client", "tests"]
branch = true
parallel = true
omit = [
"src/gotenberg-client/__about__.py",
"src/gotenberg_client/__about__.py",
]

[tool.coverage.paths]
_ = ["src/gotenberg-client", "*/gotenberg-client/src/gotenberg-client"]
tests = ["tests", "*/gotenberg-client/tests"]
gotenberg_client = ["src/gotenberg_client", "*/gotenberg_client/src/gotenberg_client"]
tests = ["tests", "*/gotenberg_client/tests"]

[tool.coverage.report]
exclude_lines = [
Expand All @@ -201,9 +203,9 @@ exclude_lines = [
]

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

Expand Down
Empty file added src/gotenberg_client/py.typed
Empty file.

0 comments on commit e860720

Please sign in to comment.