Skip to content

Commit

Permalink
Merge branch 'release/0.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
stumpylog committed Dec 4, 2023
2 parents def7db1 + 6428ac7 commit c867eb5
Show file tree
Hide file tree
Showing 21 changed files with 135 additions and 174 deletions.
16 changes: 16 additions & 0 deletions .docker/docker-compose.ci-test-edge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# docker-compose file for running testing with gotenberg container
# Can be used locally or by the CI to start the nessecary container with the
# correct networking for the tests

version: "3"
services:
gotenberg-client-test-server:
image: docker.io/gotenberg/gotenberg:edge
hostname: gotenberg-client-test-server
container_name: gotenberg-client-test-server
network_mode: host
restart: unless-stopped
command:
- "gotenberg"
- "--log-level=warn"
- "--log-format=text"
6 changes: 5 additions & 1 deletion .docker/docker-compose.ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@
version: "3"
services:
gotenberg-client-test-server:
image: docker.io/gotenberg/gotenberg:7.9.2
image: docker.io/gotenberg/gotenberg:7.10.1
hostname: gotenberg-client-test-server
container_name: gotenberg-client-test-server
network_mode: host
restart: unless-stopped
command:
- "gotenberg"
- "--log-level=warn"
- "--log-format=text"
45 changes: 43 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,48 @@ jobs:
run: |
docker compose --file ${GITHUB_WORKSPACE}/.docker/docker-compose.ci-test.yml logs
docker compose --file ${GITHUB_WORKSPACE}/.docker/docker-compose.ci-test.yml down
test-edge:
name: Test Gotenberg :edge
runs-on: ubuntu-latest
permissions:
contents: read
needs:
- lint
steps:
-
uses: actions/checkout@v4
-
name: Start containers
run: |
docker compose --file ${GITHUB_WORKSPACE}/.docker/docker-compose.ci-test-edge.yml pull --quiet
docker compose --file ${GITHUB_WORKSPACE}/.docker/docker-compose.ci-test-edge.yml up --detach
echo "Wait for container to be started"
sleep 5
-
name: Install poppler-utils
run: |
sudo apt-get update
sudo apt-get install --yes --no-install-recommends poppler-utils
-
name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: 'pip'
-
name: Install Hatch
run: |
python3 -m pip install --upgrade pip
pip install --upgrade hatch
-
name: Run tests
run: hatch run cov
-
name: Stop containers
if: always()
run: |
docker compose --file ${GITHUB_WORKSPACE}/.docker/docker-compose.ci-test-edge.yml logs
docker compose --file ${GITHUB_WORKSPACE}/.docker/docker-compose.ci-test-edge.yml down
build:
name: Build
runs-on: ubuntu-latest
Expand Down Expand Up @@ -182,4 +223,4 @@ jobs:
path: dist
-
name: Publish build to PyPI
uses: pypa/[email protected].10
uses: pypa/[email protected].11
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
141 changes: 4 additions & 137 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,163 +1,30 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so
# Ruff cache
.ruff_cache/

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
coverage.xml
coverage.json

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# Possible PDF generated from testing
tests/outputs/**
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ 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:
Expand All @@ -37,10 +37,10 @@ repos:
exclude: "(^Pipfile\\.lock$)"
# Python hooks
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.1.0'
rev: 'v0.1.6'
hooks:
- id: ruff
- repo: https://github.com/psf/black
rev: 23.10.0
rev: 23.11.0
hooks:
- id: black
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.4.0] - 2023-12-04

### Changed

- Removed some certain special cases from coverage
- Updated `pre-commit` hook versions
- Updated how pytest is configured, so it will apply to any invocation
- Updated test running image to log at warning or lower using text format
- Updated test running image from 7.9.2 to 7.10.1
- For the moment, send both `pdfa` and `pdfFormat` for compatibility with 7.9 and 7.10
- See [here](https://github.com/stumpylog/gotenberg-client/issues/5#issuecomment-1839081129) for some subtle differences in what these options mean

### Added

- Added new test job against Gotenberg's `:edge` tag

## [0.3.0] - 2023-10-17

### Added
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ As far as I can tell, no active Python library exists to interface with the Gote
- HTTP/2 enabled by default
- Abstract away the handling of multi-part/form-data and deal with `Path`s 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
- Full support for type hinting and concrete return types as much as possible
- Nearly full test coverage run against an actual Gotenberg server for multiple Python and PyPy versions

## How
Expand Down
21 changes: 13 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ classifiers = [
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"httpx[http2] ~= 0.24",
"httpx[http2] ~= 0.25; python_version >= '3.9'",
"httpx[http2] ~= 0.24; python_version < '3.9'",
"typing-extensions; python_version < '3.11'"
]
]

[project.urls]
Documentation = "https://github.com/stumpylog/gotenberg-client/#readme"
Expand Down Expand Up @@ -64,8 +65,8 @@ dependencies = [
[tool.hatch.envs.default.scripts]
version = "python3 --version"
pip-list = "pip list"
test = "pytest --pythonwarnings=all {args:tests}"
test-cov = "coverage run -m pytest --pythonwarnings=all {args:tests}"
test = "pytest {args:tests}"
test-cov = "coverage run -m pytest {args:tests}"
cov-clear = "coverage erase"
cov-report = [
"- coverage combine",
Expand All @@ -83,10 +84,9 @@ cov = [
"cov-html"
]

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

[tool.hatch.envs.pre-commit]
template = "pre-commit"
detached = true
dependencies = [
"pre-commit>=3.5.0",
]
Expand Down Expand Up @@ -207,6 +207,11 @@ ban-relative-imports = "all"
# Tests can use magic values, assertions, and relative imports
"tests/**/*" = ["PLR2004", "S101", "TID252"]

[tool.pytest.ini_options]
minversion = "7.0"
testpaths = ["tests"]
addopts = "--pythonwarnings=all"

[tool.coverage.run]
source_pkgs = ["gotenberg_client", "tests"]
branch = true
Expand Down Expand Up @@ -235,7 +240,7 @@ exclude = [
"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
Expand Down
2 changes: 1 addition & 1 deletion src/gotenberg_client/__about__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2023-present Trenton H <[email protected]>
#
# SPDX-License-Identifier: MPL-2.0
__version__ = "0.3.0"
__version__ = "0.4.0"
Loading

0 comments on commit c867eb5

Please sign in to comment.