Skip to content

Commit f009b1c

Browse files
committed
Merge branch 'release/0.9.0'
2 parents 98a78c6 + 45ff4be commit f009b1c

File tree

9 files changed

+190
-3
lines changed

9 files changed

+190
-3
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Bug Report
2+
description: Create a report to help us improve gotenberg-client
3+
title: "[BUG] "
4+
labels: ["bug"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: "Please fill out this form to help us address your bug report."
9+
10+
- type: input
11+
id: python-version
12+
attributes:
13+
label: Python Version
14+
placeholder: "e.g., 3.11.0"
15+
validations:
16+
required: true
17+
18+
- type: input
19+
id: client-version
20+
attributes:
21+
label: gotenberg-client Version
22+
placeholder: "e.g., 1.0.0"
23+
validations:
24+
required: true
25+
26+
- type: input
27+
id: server-version
28+
attributes:
29+
label: Gotenberg Server Version
30+
placeholder: "e.g., 7.8.3"
31+
validations:
32+
required: true
33+
34+
- type: textarea
35+
id: description
36+
attributes:
37+
label: Description
38+
description: A clear and concise description of the bug
39+
validations:
40+
required: true
41+
42+
- type: textarea
43+
id: reproduction
44+
attributes:
45+
label: Steps To Reproduce
46+
description: Minimal code example that demonstrates the issue
47+
render: python
48+
validations:
49+
required: true
50+
51+
- type: textarea
52+
id: expected
53+
attributes:
54+
label: Expected Behavior
55+
description: What you expected to happen
56+
validations:
57+
required: true
58+
59+
- type: textarea
60+
id: actual
61+
attributes:
62+
label: Actual Behavior
63+
description: What actually happened
64+
validations:
65+
required: true
66+
67+
- type: textarea
68+
id: logs
69+
attributes:
70+
label: Error Output
71+
description: Error messages, stack traces, or any other relevant information
72+
render: shell
73+
validations:
74+
required: false

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: 🤔 Questions and Help
4+
url: https://github.com/stumpylog/gotenberg-client/discussions/categories/q-a
5+
about: This issue tracker is not for support questions. Please refer to our Discussions.
6+
- name: 🚀 Feature Request
7+
url: https://github.com/stumpylog/gotenberg-client/discussions/categories/ideas
8+
about: Remember to search for existing feature requests and "up-vote" any you like

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
strategy:
5959
fail-fast: false
6060
matrix:
61-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', 'pypy3.9', 'pypy3.10']
61+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', 'pypy3.10']
6262

6363
steps:
6464
-

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@
66
"**/.pytest_cache": true,
77
"**/.cache": true,
88
"**/.coverage*": true
9+
},
10+
"yaml.schemas": {
11+
"https://json.schemastore.org/github-issue-config.json": "file:///u%3A/projects/gotenberg-client/.github/ISSUE_TEMPLATE/config.yml"
912
}
1013
}

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.9.0] - 2025-01-09
9+
10+
### Breaking Change
11+
12+
- Drop testing on PyPy3.9 ([#45](https://github.com/stumpylog/gotenberg-client/pull/45))
13+
- The library should still work, but required wheels for testing are no longer built against pypy3.9. Flagging this as breaking just for an FYI
14+
15+
### Added
16+
17+
- Allow setting user agent string and provide a default ([#46](https://github.com/stumpylog/gotenberg-client/pull/46))
18+
- Allow providing an instance of [httpx.BasicAuth](https://www.python-httpx.org/advanced/authentication/#basic-authentication) when creating the client ([#47](https://github.com/stumpylog/gotenberg-client/pull/47))
19+
- Documentation and project management updates ([#48](https://github.com/stumpylog/gotenberg-client/pull/48))
20+
- Enabled discussions for Q&A and Feature Requests
21+
- Created a bug report template
22+
- Created a contributing guide
23+
824
## [0.8.2] - 2024-12-17
925

1026
### Fixed

docs/contributing.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Contributing
2+
3+
This document outlines how to contribute to the gotenberg-client project effectively.
4+
5+
## Questions and Support
6+
7+
For general questions and support, please use our [Q&A Discussions](https://github.com/stumpylog/gotenberg-client/discussions/categories/q-a) forum.
8+
9+
## Feature Requests
10+
11+
We use the [Ideas category in Github Discussions](https://github.com/stumpylog/gotenberg-client/discussions/categories/ideas) for feature requests and project improvements. Please check existing discussions before creating a new one to avoid duplicates.
12+
13+
## Bug Reports
14+
15+
If you've identified a bug:
16+
17+
1. Check existing issues to avoid duplicates
18+
2. Create a new issue using the bug report template
19+
3. Include:
20+
- Python version
21+
- gotenberg-client version
22+
- Gotenberg server version
23+
- Minimal code example demonstrating the bug
24+
- Expected vs actual behavior
25+
- Error messages/stack traces if applicable
26+
27+
## Development Setup
28+
29+
1. Fork and clone the repository
30+
1. Install [`uv`](https://astral.sh/uv/) for independent tool installations
31+
```bash
32+
curl -LsSf https://astral.sh/uv/install.sh | sh # Install uv
33+
```
34+
1. Install [`hatch`](https://github.com/pypa/hatch) and [`pre-commit`](https://github.com/pre-commit/pre-commit)
35+
```bash
36+
uv tool install hatch pre-commit
37+
```
38+
1. Set up pre-commit hooks:
39+
```bash
40+
pre-commit install
41+
```
42+
43+
## Code Style
44+
45+
We use [`hatch`](https://github.com/pypa/hatch) for project management, testing, and formatting:
46+
47+
- Run tests: `hatch test`
48+
- Format & lint code: `hatch fmt`
49+
- Check formatting: `hatch fmt --check`
50+
- Check typing: `hatch run typing:run`
51+
- Build documentation: `hatch run docs:build`
52+
53+
Please ensure all tests pass and code is properly formatted before submitting changes. The code must pass the CI to be merged.
54+
55+
## Pull Request Process
56+
57+
1. Create a new branch from `develop`
58+
2. Make your changes
59+
3. Update tests and documentation
60+
4. Run the test suite
61+
5. Submit a PR against `develop`
62+
6. Reference any related issues
63+
64+
PRs should:
65+
66+
- Focus on a single feature/fix
67+
- Include tests for new functionality
68+
- Update documentation as needed
69+
- Follow existing code style
70+
71+
## License
72+
73+
By contributing, you agree that your contributions will be licensed under the same terms as the project.

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ nav:
1010
- "index.md"
1111
- "usage.md"
1212
- "routes.md"
13+
- "contributing.md"
1314
- "roadmap.md"
1415
- "changelog.md"
1516

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 <rda0128ou@mozmail.com>
22
#
33
# SPDX-License-Identifier: MPL-2.0
4-
__version__ = "0.8.2"
4+
__version__ = "0.9.0"

src/gotenberg_client/_client.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
from types import TracebackType
66
from typing import Optional
77

8+
from httpx import BasicAuth
89
from httpx import Client
910

11+
from gotenberg_client.__about__ import __version__
1012
from gotenberg_client._convert.chromium import ChromiumApi
1113
from gotenberg_client._convert.libre_office import LibreOfficeApi
1214
from gotenberg_client._convert.pdfa import PdfAApi
@@ -35,6 +37,8 @@ class GotenbergClient:
3537
def __init__(
3638
self,
3739
host: str,
40+
user_agent: str = f"gotenberg-client/{__version__}",
41+
auth: Optional[BasicAuth] = None,
3842
*,
3943
timeout: float = 30.0,
4044
log_level: int = logging.ERROR,
@@ -45,12 +49,20 @@ def __init__(
4549
4650
Args:
4751
host (str): The base URL of the Gotenberg service.
52+
user_agent (str): The value of the User-Agent header to set. Defaults to gotenberg-client/{version}
53+
auth (httpx.BasicAuth, optional): The value of the authentication for the server. Defaults to None
4854
timeout (float, optional): The timeout for API requests in seconds. Defaults to 30.0.
4955
log_level (int, optional): The logging level for httpx and httpcore. Defaults to logging.ERROR.
5056
http2 (bool, optional): Whether to use HTTP/2. Defaults to True.
5157
"""
5258
# Configure the client
53-
self._client = Client(base_url=host, timeout=timeout, http2=http2)
59+
self._client = Client(
60+
base_url=host,
61+
timeout=timeout,
62+
http2=http2,
63+
auth=auth,
64+
headers={"User-Agent": user_agent},
65+
)
5466

5567
# Set the log level
5668
logging.getLogger("httpx").setLevel(log_level)

0 commit comments

Comments
 (0)