Skip to content

Commit a98e9db

Browse files
committed
Merge branch 'release/0.1.0'
2 parents b9f602f + 7938323 commit a98e9db

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+2414
-2
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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:
8+
image: docker.io/gotenberg/gotenberg:7.9.2
9+
hostname: gotenberg
10+
container_name: gotenberg
11+
network_mode: host
12+
restart: unless-stopped

.editorconfig

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# EditorConfig: http://EditorConfig.org
2+
3+
root = true
4+
5+
[*]
6+
indent_style = tab
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
end_of_line = lf
11+
charset = utf-8
12+
max_line_length = 88
13+
14+
[{*.html,*.css,*.js}]
15+
max_line_length = off
16+
17+
[*.py]
18+
indent_size = 4
19+
indent_style = space
20+
21+
[*.{yml,yaml}]
22+
indent_style = space
23+
24+
[*.rst]
25+
indent_style = space
26+
27+
[*.md]
28+
indent_style = space
29+
30+
# Tests don't get a line width restriction. It's still a good idea to follow
31+
# the 79 character rule, but in the interests of clarity, tests often need to
32+
# violate it.
33+
[**/test_*.py]
34+
max_line_length = off
35+
36+
[*.toml*]
37+
indent_style = space

.github/dependabot.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates#package-ecosystem
2+
3+
version: 2
4+
updates:
5+
6+
# Enable version updates for Python
7+
- package-ecosystem: "pip"
8+
target-branch: "develop"
9+
# Look for a `Pipfile` in the `root` directory
10+
directory: "/"
11+
# Check for updates once a week
12+
schedule:
13+
interval: "weekly"
14+
labels:
15+
- "dependencies"
16+
17+
# Enable updates for Github Actions
18+
- package-ecosystem: "github-actions"
19+
target-branch: "develop"
20+
directory: "/"
21+
schedule:
22+
# Check for updates to GitHub Actions every month
23+
interval: "monthly"
24+
labels:
25+
- "dependencies"

.github/workflows/ci.yml

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches:
7+
- main
8+
- develop
9+
10+
concurrency:
11+
group: test-${{ github.ref_name }}
12+
cancel-in-progress: true
13+
14+
env:
15+
PYTHONUNBUFFERED: "1"
16+
FORCE_COLOR: "1"
17+
18+
jobs:
19+
lint:
20+
name: Lint
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: read
24+
steps:
25+
-
26+
uses: actions/checkout@v3
27+
-
28+
name: Set up Python 3.10
29+
uses: actions/setup-python@v4
30+
with:
31+
python-version: '3.10'
32+
cache: 'pip'
33+
-
34+
name: Install Hatch
35+
run: |
36+
pip3 --quiet install --upgrade hatch
37+
-
38+
name: Lint project
39+
run: |
40+
hatch run lint:all
41+
-
42+
name: Check files with pre-commit
43+
uses: pre-commit/[email protected]
44+
test:
45+
name: Python ${{ matrix.python-version }}
46+
runs-on: ubuntu-latest
47+
permissions:
48+
contents: read
49+
needs:
50+
- lint
51+
strategy:
52+
fail-fast: false
53+
matrix:
54+
# No pikepdf wheels for pypy3.8
55+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy3.9']
56+
57+
steps:
58+
-
59+
uses: actions/checkout@v3
60+
-
61+
name: Start containers
62+
run: |
63+
docker compose --file ${GITHUB_WORKSPACE}/.docker/docker-compose.ci-test.yml pull --quiet
64+
docker compose --file ${GITHUB_WORKSPACE}/.docker/docker-compose.ci-test.yml up --detach
65+
echo "Wait for container to be started"
66+
sleep 5
67+
-
68+
name: Set up Python ${{ matrix.python-version }}
69+
uses: actions/setup-python@v4
70+
with:
71+
python-version: ${{ matrix.python-version }}
72+
cache: 'pip'
73+
-
74+
name: Install Hatch
75+
run: pip install --upgrade hatch
76+
-
77+
name: Run tests
78+
run: hatch run cov
79+
-
80+
name: Upload coverage to Codecov
81+
if: matrix.python-version == '3.10'
82+
uses: codecov/codecov-action@v3
83+
with:
84+
# not required for public repos, but intermittently fails otherwise
85+
token: ${{ secrets.CODECOV_TOKEN }}
86+
-
87+
name: Stop containers
88+
if: always()
89+
run: |
90+
docker compose --file ${GITHUB_WORKSPACE}/.docker/docker-compose.ci-test.yml logs
91+
docker compose --file ${GITHUB_WORKSPACE}/.docker/docker-compose.ci-test.yml down
92+
93+
build:
94+
name: Build
95+
runs-on: ubuntu-latest
96+
permissions:
97+
contents: read
98+
needs:
99+
- lint
100+
steps:
101+
-
102+
uses: actions/checkout@v3
103+
-
104+
name: Set up Python 3.10
105+
uses: actions/setup-python@v4
106+
with:
107+
python-version: '3.10'
108+
cache: 'pip'
109+
-
110+
name: Install Hatch
111+
run: |
112+
pip3 --quiet install --upgrade hatch
113+
-
114+
name: Build
115+
run: |
116+
hatch build --clean
117+
-
118+
uses: actions/upload-artifact@v3
119+
with:
120+
name: artifacts
121+
path: dist/*
122+
if-no-files-found: error
123+
retention-days: 7
124+
125+
create-release:
126+
name: Release
127+
runs-on: ubuntu-latest
128+
if: startsWith(github.ref, 'refs/tags/')
129+
permissions:
130+
contents: write
131+
needs:
132+
- build
133+
- test
134+
steps:
135+
-
136+
uses: actions/checkout@v3
137+
-
138+
uses: actions/download-artifact@v3
139+
with:
140+
name: artifacts
141+
path: dist
142+
-
143+
name: Get latest release info
144+
id: query-release-info
145+
uses: release-flow/keep-a-changelog-action@v2
146+
with:
147+
command: query
148+
version: ${{ github.ref_name }}
149+
-
150+
name: Display release info
151+
run: |
152+
echo "Version: ${{ steps.query-release-info.outputs.version }}"
153+
echo "Date: ${{ steps.query-release-info.outputs.release-date }}"
154+
echo "${{ steps.query-release-info.outputs.release-notes }}"
155+
-
156+
uses: ncipollo/release-action@v1
157+
with:
158+
artifacts: "dist/*.tar.gz,dist/*.whl"
159+
body: ${{ steps.query-release-info.outputs.release-notes }}
160+
161+
pypi-publish:
162+
name: Publish
163+
runs-on: ubuntu-latest
164+
if: startsWith(github.ref, 'refs/tags/')
165+
permissions:
166+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
167+
needs:
168+
- build
169+
- test
170+
steps:
171+
-
172+
uses: actions/download-artifact@v3
173+
with:
174+
name: artifacts
175+
path: dist
176+
-
177+
name: Publish build to PyPI
178+
uses: pypa/[email protected]

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ coverage.xml
5050
.hypothesis/
5151
.pytest_cache/
5252
cover/
53+
coverage.json
5354

5455
# Translations
5556
*.mo
@@ -158,3 +159,5 @@ cython_debug/
158159
# and can be added to the global gitignore or merged into this file. For a more nuclear
159160
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
160161
#.idea/
162+
163+
tests/outputs/**

.pre-commit-config.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# This file configures pre-commit hooks.
2+
# See https://pre-commit.com/ for general information
3+
# See https://pre-commit.com/hooks.html for a listing of possible hooks
4+
5+
repos:
6+
# General hooks
7+
- repo: https://github.com/pre-commit/pre-commit-hooks
8+
rev: v4.5.0
9+
hooks:
10+
- id: check-docstring-first
11+
- id: check-json
12+
exclude: "tsconfig.*json"
13+
- id: check-yaml
14+
- id: check-toml
15+
- id: check-executables-have-shebangs
16+
- id: end-of-file-fixer
17+
exclude_types:
18+
- svg
19+
- pofile
20+
exclude: "(^LICENSE$)"
21+
- id: mixed-line-ending
22+
args:
23+
- "--fix=lf"
24+
- id: trailing-whitespace
25+
exclude_types:
26+
- svg
27+
- id: check-case-conflict
28+
- id: detect-private-key
29+
- repo: https://github.com/pre-commit/mirrors-prettier
30+
rev: 'v3.0.3'
31+
hooks:
32+
- id: prettier
33+
types_or:
34+
- javascript
35+
- ts
36+
- markdown
37+
exclude: "(^Pipfile\\.lock$)"
38+
# Python hooks
39+
- repo: https://github.com/astral-sh/ruff-pre-commit
40+
rev: 'v0.0.292'
41+
hooks:
42+
- id: ruff
43+
- repo: https://github.com/psf/black
44+
rev: 23.9.1
45+
hooks:
46+
- id: black

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [0.1.0] - 2023-10-15
9+
10+
### Added
11+
12+
- Chromium conversion routes
13+
- LibreOffice conversion routes
14+
- PDF/A conversion route
15+
- PDF merge route
16+
- Health status route
17+
- Testing and typing all setup and passing

0 commit comments

Comments
 (0)