-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial development work on a Python client for the Gotenberg API, wi…
…th most routes implemented
- Loading branch information
Showing
46 changed files
with
1,834 additions
and
40 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
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
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 |
---|---|---|
|
@@ -11,7 +11,7 @@ requires-python = ">=3.8" | |
license = "MPL-2.0" | ||
keywords = [] | ||
authors = [ | ||
{ name = "Trenton H", email = "[email protected].com" }, | ||
{ name = "Trenton H", email = "rda0128ou@mozmail.com" }, | ||
] | ||
classifiers = [ | ||
"Development Status :: 4 - Beta", | ||
|
@@ -23,19 +23,27 @@ classifiers = [ | |
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Programming Language :: Python :: Implementation :: CPython", | ||
"Programming Language :: Python :: Implementation :: PyPy", | ||
] | ||
dependencies = ["httpx[http2] ~= 0.24"] | ||
dependencies = [ | ||
"httpx[http2] ~= 0.24", | ||
"typing-extensions; python_version < '3.11'" | ||
] | ||
|
||
[project.urls] | ||
Documentation = "https://github.com/stumpylog/gotenberg-client/#readme" | ||
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"] | ||
magic = ["python-magic"] | ||
|
||
[tool.hatch.version] | ||
path = "src/_/__about__.py" | ||
path = "src/gotenberg_client/__about__.py" | ||
|
||
[tool.hatch.build.targets.sdist] | ||
exclude = [ | ||
|
@@ -45,19 +53,20 @@ exclude = [ | |
|
||
[tool.hatch.envs.default] | ||
dependencies = [ | ||
"coverage[toml] >= 7.0", | ||
"pytest >= 7.0", | ||
"coverage[toml] >= 7.3", | ||
"pytest >= 7.4", | ||
"pytest-sugar", | ||
"pytest-cov", | ||
"pytest-xdist", | ||
"pytest-httpx ~= 0.26; python_version >= '3.9'", | ||
"pytest-httpx ~= 0.22; python_version < '3.9'", | ||
"pikepdf", | ||
"python-magic", | ||
"brotli", | ||
] | ||
|
||
[tool.hatch.envs.default.scripts] | ||
version = "python3 --version" | ||
test = "pytest {args:tests}" | ||
test-cov = "coverage run -m pytest {args:tests}" | ||
test = "pytest --pythonwarnings=all {args:tests}" | ||
test-cov = "coverage run -m pytest --pythonwarnings=all {args:tests}" | ||
cov-clear = "coverage erase" | ||
cov-report = [ | ||
"- coverage combine", | ||
|
@@ -70,12 +79,13 @@ cov = [ | |
"cov-clear", | ||
"test-cov", | ||
"cov-report", | ||
"cov-json" | ||
"cov-json", | ||
"cov-html" | ||
] | ||
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 = [ | ||
|
@@ -86,25 +96,27 @@ 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 --version", | ||
"mypy --install-types --non-interactive {args:src/gotenberg_client}" | ||
] | ||
style = [ | ||
"ruff {args:.}", | ||
"black --check --diff {args:.}", | ||
] | ||
fmt = [ | ||
"black {args:.}", | ||
"ruff --fix {args:.}", | ||
"ruff {args:.}", | ||
"style", | ||
] | ||
all = [ | ||
|
@@ -113,12 +125,14 @@ all = [ | |
] | ||
|
||
[tool.black] | ||
target-version = ["py37"] | ||
target-version = ["py38"] | ||
line-length = 120 | ||
skip-string-normalization = true | ||
|
||
[tool.ruff] | ||
target-version = "py37" | ||
fix = true | ||
output-format = "grouped" | ||
target-version = "py38" | ||
line-length = 120 | ||
extend-select = [ | ||
"A", | ||
|
@@ -165,14 +179,10 @@ ignore = [ | |
# Ignore complexity | ||
"C901", "PLR0911", "PLR0912", "PLR0913", "PLR0915", | ||
] | ||
unfixable = [ | ||
# Don't touch unused imports | ||
"F401", | ||
] | ||
|
||
[tool.ruff.isort] | ||
force-single-line = true | ||
known-first-party = ["gotenberg-client"] | ||
known-first-party = ["gotenberg_client"] | ||
|
||
[tool.ruff.flake8-tidy-imports] | ||
ban-relative-imports = "all" | ||
|
@@ -182,28 +192,37 @@ 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", | ||
"tests/conftest.py", | ||
"tests/utils.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 = [ | ||
"no cov", | ||
"if __name__ == .__main__.:", | ||
"if TYPE_CHECKING:", | ||
"if SAVE_OUTPUTS:", | ||
] | ||
|
||
[tool.mypy] | ||
#disallow_any_expr = true | ||
#disallow_untyped_defs = true | ||
#disallow_incomplete_defs = true | ||
exclude = [ | ||
"tests/test_convert_chromium_html.py", | ||
"tests/test_convert_chromium_url.py", | ||
"tests/test_convert_chromium_markdown.py", | ||
"tests/conftest.py", | ||
] | ||
disallow_any_expr = true | ||
disallow_untyped_defs = true | ||
disallow_incomplete_defs = true | ||
check_untyped_defs = true | ||
strict_optional = true | ||
|
||
|
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,4 +1,4 @@ | ||
# SPDX-FileCopyrightText: 2023-present Trenton H <[email protected].com> | ||
# SPDX-FileCopyrightText: 2023-present Trenton H <rda0128ou@mozmail.com> | ||
# | ||
# SPDX-License-Identifier: MPL-2.0 | ||
__version__ = "0.0.1" |
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,3 +1,6 @@ | ||
# SPDX-FileCopyrightText: 2023-present Trenton H <[email protected].com> | ||
# SPDX-FileCopyrightText: 2023-present Trenton H <rda0128ou@mozmail.com> | ||
# | ||
# SPDX-License-Identifier: MPL-2.0 | ||
from gotenberg_client._client import GotenbergClient | ||
|
||
__all__ = ["GotenbergClient"] |
Oops, something went wrong.