Skip to content

Commit

Permalink
Merge branch 'release/0.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
stumpylog committed Jun 13, 2024
2 parents d3ea83b + 109be54 commit 83cb323
Show file tree
Hide file tree
Showing 35 changed files with 1,023 additions and 392 deletions.
9 changes: 9 additions & 0 deletions .docker/content/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!doctype html>
<html>
<head>
<title>This is the title of the webpage!</title>
</head>
<body>
<p>This is an example paragraph. Anything in the <strong>body</strong> tag will appear on the page, just like this <strong>p</strong> tag and its contents.</p>
</body>
</html>
13 changes: 11 additions & 2 deletions .docker/docker-compose.ci-test-edge.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# docker-compose file for running testing with gotenberg container
# Can be used locally or by the CI to start the nessecary container with the
# Can be used locally or by the CI to start the necessary container with the
# correct networking for the tests

version: "3"
Expand All @@ -12,5 +12,14 @@ services:
restart: unless-stopped
command:
- "gotenberg"
- "--log-level=warn"
- "--log-level=info"
- "--log-format=text"
nginx-webserver:
image: docker.io/nginx:1-alpine
hostname: nginx-webserver
container_name: nginx-webserver
ports:
- "8888:80"
restart: unless-stopped
volumes:
- ./content:/usr/share/nginx/html:ro
15 changes: 13 additions & 2 deletions .docker/docker-compose.ci-test.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# docker-compose file for running testing with gotenberg container
# Can be used locally or by the CI to start the nessecary container with the
# Can be used locally or by the CI to start the necessary container with the
# correct networking for the tests

version: "3"
services:
gotenberg-client-test-server:
image: docker.io/gotenberg/gotenberg:7.10.1
image: docker.io/gotenberg/gotenberg:8.5.1
hostname: gotenberg-client-test-server
container_name: gotenberg-client-test-server
network_mode: host
Expand All @@ -14,3 +14,14 @@ services:
- "gotenberg"
- "--log-level=warn"
- "--log-format=text"
nginx-webserver:
image: docker.io/nginx:1-alpine
hostname: nginx-webserver
container_name: nginx-webserver
ports:
- "8888:80"
restart: unless-stopped
environment:
NGINX_ENTRYPOINT_QUIET_LOGS: 1
volumes:
- ./content:/usr/share/nginx/html:ro
81 changes: 25 additions & 56 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,19 @@ jobs:
-
name: Install Hatch
run: |
pip3 --quiet install --upgrade hatch
pip3 --quiet install --upgrade hatch uv
hatch --version
uv --version
-
name: Lint project
run: |
hatch run lint:all
hatch fmt --check
-
name: Check files with pre-commit
uses: pre-commit/[email protected]
uses: pre-commit/[email protected]

test:
name: Python ${{ matrix.python-version }}
name: Test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -52,7 +55,7 @@ jobs:
fail-fast: false
matrix:
# No pikepdf wheels for pypy3.8
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy3.9']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy3.9', 'pypy3.10']

steps:
-
Expand All @@ -79,15 +82,22 @@ jobs:
-
name: Install Hatch
run: |
python3 -m pip install --upgrade pip
pip install --upgrade hatch
pip3 --quiet install --upgrade hatch uv
hatch --version
uv --version
-
name: Show environment
run: |
hatch test --show --python ${{ matrix.python-version }}
-
name: Run tests
run: hatch run cov
run: |
hatch test --cover --python ${{ matrix.python-version }}
ls -ahl .
-
name: Upload coverage to Codecov
if: matrix.python-version == '3.10'
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
# not required for public repos, but intermittently fails otherwise
token: ${{ secrets.CODECOV_TOKEN }}
Expand All @@ -97,50 +107,7 @@ 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
docker inspect gotenberg-client-test-edge-server
-
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@v5
with:
python-version: "3.11"
cache: 'pip'
-
name: Install Hatch
run: |
python3 -m pip install --upgrade pip
pip install --upgrade hatch
-
name: Run tests
continue-on-error: true
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 All @@ -160,7 +127,9 @@ jobs:
-
name: Install Hatch
run: |
pip3 --quiet install --upgrade hatch
pip3 --quiet install --upgrade hatch uv
hatch --version
uv --version
-
name: Build
run: |
Expand Down Expand Up @@ -235,7 +204,7 @@ jobs:
-
name: Get latest release info
id: query-release-info
uses: release-flow/keep-a-changelog-action@v2
uses: release-flow/keep-a-changelog-action@v3
with:
command: query
version: ${{ github.ref_name }}
Expand Down Expand Up @@ -269,4 +238,4 @@ jobs:
path: dist
-
name: Publish build to PyPI
uses: pypa/[email protected].11
uses: pypa/[email protected].14
20 changes: 12 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
repos:
# General hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-docstring-first
- id: check-json
Expand All @@ -19,7 +19,7 @@ repos:
exclude_types:
- svg
- pofile
exclude: "(^LICENSE$)"
exclude: "(^LICENSE$|^docs/changelog.md$)"
- id: mixed-line-ending
args:
- "--fix=lf"
Expand All @@ -36,13 +36,17 @@ repos:
- javascript
- ts
- markdown
exclude: "(^Pipfile\\.lock$)"
- json
exclude: "(^docs/changelog.md$)"
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
# Python hooks
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.1.11'
rev: 'v0.4.6'
hooks:
# Run the linter.
- id: ruff
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.12.1
hooks:
- id: black
# Run the formatter.
- id: ruff-format
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"files.exclude": {
"**/__pycache__": true,
"**/.mypy_cache": true,
"**/.ruff_cache": true,
"**/.pytest_cache": true,
"**/.cache": true,
"**/.coverage*": true
}
}
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,36 @@ 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.6.0] - 2024-06-13

### Breaking Change

- Only Gotenberg 8 is now supported

### Fixed

- The documentation site's changelog was not updating with the changes

### Added

- `codespell` pre-commit hook
- Link to the full documentation from the README
- Documentation of all implemented routes ([#16](https://github.com/stumpylog/gotenberg-client/pull/16))
- Page margins may now specify the units of the margin ([#21](https://github.com/stumpylog/gotenberg-client/pull/21))

### Changed

- Bump codecov/codecov-action from 3 to 4 by @dependabot ([#11](https://github.com/stumpylog/gotenberg-client/pull/11))
- Bump release-flow/keep-a-changelog-action from 2 to 3 by @dependabot ([#12](https://github.com/stumpylog/gotenberg-client/pull/12))
- Bump pypa/gh-action-pypi-publish from 1.8.11 to 1.8.12 by @dependabot ([#13](https://github.com/stumpylog/gotenberg-client/pull/13))
- Bump pre-commit/action from 3.0.0 to 3.0.1 by @dependabot ([#14](https://github.com/stumpylog/gotenberg-client/pull/14))
- Bump pypa/gh-action-pypi-publish from 1.8.12 to 1.8.14 by @dependabot ([#15](https://github.com/stumpylog/gotenberg-client/pull/15))
- Use hatch commands for testing and linting ([#17](https://github.com/stumpylog/gotenberg-client/pull/17))
- Update testing Docker image to Gotenberg 8.5.0 ([#18](https://github.com/stumpylog/gotenberg-client/pull/18))
- chore: Formats JSON files with prettier ([#19](https://github.com/stumpylog/gotenberg-client/pull/19))
- chore: Updates Gotenberg test image to 8.5.1 ([#20](https://github.com/stumpylog/gotenberg-client/pull/20))
- chore: Updates mike to ~2.1.1 ([#22](https://github.com/stumpylog/gotenberg-client/pull/22))

## [0.5.0] - 2024-01-11

### Added
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ endpoint. All the routes use the same format and general idea.
- Files will be PDF or ZIP, depending on what endpoint and its configuration. Endpoints which handle
multiple files, but don't merge them, return a ZIP archive of the resulting PDFs

For more detailed examples, check the [documentation](https://stumpylog.github.io/gotenberg-client/)

### Examples

Converting a single HTML file into a PDF:
Expand Down Expand Up @@ -84,7 +86,7 @@ from gotenberg_client.options import PdfAFormat

with GotenbergClient("http://localhost:3000") as client:
with client.chromium.html_to_pdf() as route:
response = route.index("my-index.html").resources(["image.png", "style.css"]).pdf_format(PdfAFormat.A1a).run()
response = route.index("my-index.html").resources(["image.png", "style.css"]).pdf_format(PdfAFormat.A2b).run()
Path("my-index.pdf").write_bytes(response.content)
```

Expand Down
80 changes: 0 additions & 80 deletions docs/changelog.md

This file was deleted.

1 change: 1 addition & 0 deletions docs/changelog.md
Loading

0 comments on commit 83cb323

Please sign in to comment.