Skip to content

Commit c867eb5

Browse files
committed
Merge branch 'release/0.4.0'
2 parents def7db1 + 6428ac7 commit c867eb5

21 files changed

+135
-174
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# docker-compose file for running testing with gotenberg container
2+
# Can be used locally or by the CI to start the nessecary container with the
3+
# correct networking for the tests
4+
5+
version: "3"
6+
services:
7+
gotenberg-client-test-server:
8+
image: docker.io/gotenberg/gotenberg:edge
9+
hostname: gotenberg-client-test-server
10+
container_name: gotenberg-client-test-server
11+
network_mode: host
12+
restart: unless-stopped
13+
command:
14+
- "gotenberg"
15+
- "--log-level=warn"
16+
- "--log-format=text"

.docker/docker-compose.ci-test.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@
55
version: "3"
66
services:
77
gotenberg-client-test-server:
8-
image: docker.io/gotenberg/gotenberg:7.9.2
8+
image: docker.io/gotenberg/gotenberg:7.10.1
99
hostname: gotenberg-client-test-server
1010
container_name: gotenberg-client-test-server
1111
network_mode: host
1212
restart: unless-stopped
13+
command:
14+
- "gotenberg"
15+
- "--log-level=warn"
16+
- "--log-format=text"

.github/workflows/ci.yml

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,48 @@ jobs:
9696
run: |
9797
docker compose --file ${GITHUB_WORKSPACE}/.docker/docker-compose.ci-test.yml logs
9898
docker compose --file ${GITHUB_WORKSPACE}/.docker/docker-compose.ci-test.yml down
99-
99+
test-edge:
100+
name: Test Gotenberg :edge
101+
runs-on: ubuntu-latest
102+
permissions:
103+
contents: read
104+
needs:
105+
- lint
106+
steps:
107+
-
108+
uses: actions/checkout@v4
109+
-
110+
name: Start containers
111+
run: |
112+
docker compose --file ${GITHUB_WORKSPACE}/.docker/docker-compose.ci-test-edge.yml pull --quiet
113+
docker compose --file ${GITHUB_WORKSPACE}/.docker/docker-compose.ci-test-edge.yml up --detach
114+
echo "Wait for container to be started"
115+
sleep 5
116+
-
117+
name: Install poppler-utils
118+
run: |
119+
sudo apt-get update
120+
sudo apt-get install --yes --no-install-recommends poppler-utils
121+
-
122+
name: Set up Python 3.11
123+
uses: actions/setup-python@v4
124+
with:
125+
python-version: "3.11"
126+
cache: 'pip'
127+
-
128+
name: Install Hatch
129+
run: |
130+
python3 -m pip install --upgrade pip
131+
pip install --upgrade hatch
132+
-
133+
name: Run tests
134+
run: hatch run cov
135+
-
136+
name: Stop containers
137+
if: always()
138+
run: |
139+
docker compose --file ${GITHUB_WORKSPACE}/.docker/docker-compose.ci-test-edge.yml logs
140+
docker compose --file ${GITHUB_WORKSPACE}/.docker/docker-compose.ci-test-edge.yml down
100141
build:
101142
name: Build
102143
runs-on: ubuntu-latest
@@ -182,4 +223,4 @@ jobs:
182223
path: dist
183224
-
184225
name: Publish build to PyPI
185-
uses: pypa/[email protected].10
226+
uses: pypa/[email protected].11

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252

5353
steps:
5454
- name: Checkout repository
55-
uses: actions/checkout@v3
55+
uses: actions/checkout@v4
5656

5757
# Initializes the CodeQL tools for scanning.
5858
- name: Initialize CodeQL

.gitignore

Lines changed: 4 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -1,163 +1,30 @@
11
# Byte-compiled / optimized / DLL files
22
__pycache__/
33
*.py[cod]
4-
*$py.class
54

6-
# C extensions
7-
*.so
5+
# Ruff cache
6+
.ruff_cache/
87

98
# Distribution / packaging
10-
.Python
11-
build/
12-
develop-eggs/
139
dist/
14-
downloads/
15-
eggs/
16-
.eggs/
17-
lib/
18-
lib64/
19-
parts/
20-
sdist/
21-
var/
22-
wheels/
23-
share/python-wheels/
24-
*.egg-info/
25-
.installed.cfg
26-
*.egg
27-
MANIFEST
28-
29-
# PyInstaller
30-
# Usually these files are written by a python script from a template
31-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32-
*.manifest
33-
*.spec
34-
35-
# Installer logs
36-
pip-log.txt
37-
pip-delete-this-directory.txt
3810

3911
# Unit test / coverage reports
4012
htmlcov/
41-
.tox/
42-
.nox/
4313
.coverage
4414
.coverage.*
45-
.cache
46-
nosetests.xml
47-
coverage.xml
48-
*.cover
49-
*.py,cover
50-
.hypothesis/
5115
.pytest_cache/
52-
cover/
16+
coverage.xml
5317
coverage.json
5418

55-
# Translations
56-
*.mo
57-
*.pot
58-
59-
# Django stuff:
60-
*.log
61-
local_settings.py
62-
db.sqlite3
63-
db.sqlite3-journal
64-
65-
# Flask stuff:
66-
instance/
67-
.webassets-cache
68-
69-
# Scrapy stuff:
70-
.scrapy
71-
72-
# Sphinx documentation
73-
docs/_build/
74-
75-
# PyBuilder
76-
.pybuilder/
77-
target/
78-
79-
# Jupyter Notebook
80-
.ipynb_checkpoints
81-
82-
# IPython
83-
profile_default/
84-
ipython_config.py
85-
86-
# pyenv
87-
# For a library or package, you might want to ignore these files since the code is
88-
# intended to run in multiple environments; otherwise, check them in:
89-
# .python-version
90-
91-
# pipenv
92-
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93-
# However, in case of collaboration, if having platform-specific dependencies or dependencies
94-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
95-
# install all needed dependencies.
96-
#Pipfile.lock
97-
98-
# poetry
99-
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
100-
# This is especially recommended for binary packages to ensure reproducibility, and is more
101-
# commonly ignored for libraries.
102-
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
103-
#poetry.lock
104-
105-
# pdm
106-
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
107-
#pdm.lock
108-
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
109-
# in version control.
110-
# https://pdm.fming.dev/#use-with-ide
111-
.pdm.toml
112-
113-
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
114-
__pypackages__/
115-
116-
# Celery stuff
117-
celerybeat-schedule
118-
celerybeat.pid
119-
120-
# SageMath parsed files
121-
*.sage.py
12219

12320
# Environments
12421
.env
12522
.venv
12623
env/
12724
venv/
128-
ENV/
129-
env.bak/
130-
venv.bak/
131-
132-
# Spyder project settings
133-
.spyderproject
134-
.spyproject
135-
136-
# Rope project settings
137-
.ropeproject
138-
139-
# mkdocs documentation
140-
/site
14125

14226
# mypy
14327
.mypy_cache/
144-
.dmypy.json
145-
dmypy.json
146-
147-
# Pyre type checker
148-
.pyre/
149-
150-
# pytype static type analyzer
151-
.pytype/
152-
153-
# Cython debug symbols
154-
cython_debug/
155-
156-
# PyCharm
157-
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
158-
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
159-
# and can be added to the global gitignore or merged into this file. For a more nuclear
160-
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
161-
#.idea/
16228

29+
# Possible PDF generated from testing
16330
tests/outputs/**

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ repos:
2727
- id: check-case-conflict
2828
- id: detect-private-key
2929
- repo: https://github.com/pre-commit/mirrors-prettier
30-
rev: 'v3.0.3'
30+
rev: 'v3.1.0'
3131
hooks:
3232
- id: prettier
3333
types_or:
@@ -37,10 +37,10 @@ repos:
3737
exclude: "(^Pipfile\\.lock$)"
3838
# Python hooks
3939
- repo: https://github.com/astral-sh/ruff-pre-commit
40-
rev: 'v0.1.0'
40+
rev: 'v0.1.6'
4141
hooks:
4242
- id: ruff
4343
- repo: https://github.com/psf/black
44-
rev: 23.10.0
44+
rev: 23.11.0
4545
hooks:
4646
- id: black

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.4.0] - 2023-12-04
9+
10+
### Changed
11+
12+
- Removed some certain special cases from coverage
13+
- Updated `pre-commit` hook versions
14+
- Updated how pytest is configured, so it will apply to any invocation
15+
- Updated test running image to log at warning or lower using text format
16+
- Updated test running image from 7.9.2 to 7.10.1
17+
- For the moment, send both `pdfa` and `pdfFormat` for compatibility with 7.9 and 7.10
18+
- See [here](https://github.com/stumpylog/gotenberg-client/issues/5#issuecomment-1839081129) for some subtle differences in what these options mean
19+
20+
### Added
21+
22+
- Added new test job against Gotenberg's `:edge` tag
23+
824
## [0.3.0] - 2023-10-17
925

1026
### Added

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ As far as I can tell, no active Python library exists to interface with the Gote
3737
- HTTP/2 enabled by default
3838
- Abstract away the handling of multi-part/form-data and deal with `Path`s instead
3939
- Based on the modern [httpx](https://github.com/encode/httpx) library
40-
- Full support for type hinting and concrete return types as mush as possible
40+
- Full support for type hinting and concrete return types as much as possible
4141
- Nearly full test coverage run against an actual Gotenberg server for multiple Python and PyPy versions
4242

4343
## How

pyproject.toml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ classifiers = [
2828
"Programming Language :: Python :: Implementation :: PyPy",
2929
]
3030
dependencies = [
31-
"httpx[http2] ~= 0.24",
31+
"httpx[http2] ~= 0.25; python_version >= '3.9'",
32+
"httpx[http2] ~= 0.24; python_version < '3.9'",
3233
"typing-extensions; python_version < '3.11'"
33-
]
34+
]
3435

3536
[project.urls]
3637
Documentation = "https://github.com/stumpylog/gotenberg-client/#readme"
@@ -64,8 +65,8 @@ dependencies = [
6465
[tool.hatch.envs.default.scripts]
6566
version = "python3 --version"
6667
pip-list = "pip list"
67-
test = "pytest --pythonwarnings=all {args:tests}"
68-
test-cov = "coverage run -m pytest --pythonwarnings=all {args:tests}"
68+
test = "pytest {args:tests}"
69+
test-cov = "coverage run -m pytest {args:tests}"
6970
cov-clear = "coverage erase"
7071
cov-report = [
7172
"- coverage combine",
@@ -83,10 +84,9 @@ cov = [
8384
"cov-html"
8485
]
8586

86-
[[tool.hatch.envs.all.matrix]]
87-
python = ["3.8", "3.9", "3.10", "3.11", "3.12"]
88-
8987
[tool.hatch.envs.pre-commit]
88+
template = "pre-commit"
89+
detached = true
9090
dependencies = [
9191
"pre-commit>=3.5.0",
9292
]
@@ -207,6 +207,11 @@ ban-relative-imports = "all"
207207
# Tests can use magic values, assertions, and relative imports
208208
"tests/**/*" = ["PLR2004", "S101", "TID252"]
209209

210+
[tool.pytest.ini_options]
211+
minversion = "7.0"
212+
testpaths = ["tests"]
213+
addopts = "--pythonwarnings=all"
214+
210215
[tool.coverage.run]
211216
source_pkgs = ["gotenberg_client", "tests"]
212217
branch = true
@@ -235,7 +240,7 @@ exclude = [
235240
"tests/test_convert_chromium_url.py",
236241
"tests/test_convert_chromium_markdown.py",
237242
"tests/conftest.py",
238-
]
243+
]
239244
disallow_any_expr = true
240245
disallow_untyped_defs = true
241246
disallow_incomplete_defs = true

src/gotenberg_client/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# SPDX-FileCopyrightText: 2023-present Trenton H <[email protected]>
22
#
33
# SPDX-License-Identifier: MPL-2.0
4-
__version__ = "0.3.0"
4+
__version__ = "0.4.0"

0 commit comments

Comments
 (0)