Skip to content

Commit 2485b73

Browse files
committed
Merge branch 'release/0.2.0'
2 parents a98e9db + b8910b8 commit 2485b73

File tree

10 files changed

+120
-12
lines changed

10 files changed

+120
-12
lines changed

.codecov.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
codecov:
2+
require_ci_to_pass: true
3+
comment:
4+
require_changes: true

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
contents: read
2424
steps:
2525
-
26-
uses: actions/checkout@v3
26+
uses: actions/checkout@v4
2727
-
2828
name: Set up Python 3.10
2929
uses: actions/setup-python@v4
@@ -56,7 +56,7 @@ jobs:
5656

5757
steps:
5858
-
59-
uses: actions/checkout@v3
59+
uses: actions/checkout@v4
6060
-
6161
name: Start containers
6262
run: |
@@ -99,7 +99,7 @@ jobs:
9999
- lint
100100
steps:
101101
-
102-
uses: actions/checkout@v3
102+
uses: actions/checkout@v4
103103
-
104104
name: Set up Python 3.10
105105
uses: actions/setup-python@v4
@@ -133,7 +133,7 @@ jobs:
133133
- test
134134
steps:
135135
-
136-
uses: actions/checkout@v3
136+
uses: actions/checkout@v4
137137
-
138138
uses: actions/download-artifact@v3
139139
with:
@@ -175,4 +175,4 @@ jobs:
175175
path: dist
176176
-
177177
name: Publish build to PyPI
178-
uses: pypa/[email protected].8
178+
uses: pypa/[email protected].10

.github/workflows/codeql.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches:
17+
- "main"
18+
- "develop"
19+
- "feature/**"
20+
- "fix/**"
21+
pull_request:
22+
# The branches below must be a subset of the branches above
23+
branches:
24+
- "main"
25+
- "develop"
26+
schedule:
27+
- cron: '43 10 * * 1'
28+
29+
jobs:
30+
analyze:
31+
name: Analyze
32+
# Runner size impacts CodeQL analysis time. To learn more, please see:
33+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
34+
# - https://gh.io/supported-runners-and-hardware-resources
35+
# - https://gh.io/using-larger-runners
36+
# Consider using larger runners for possible analysis time improvements.
37+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
38+
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
39+
permissions:
40+
actions: read
41+
contents: read
42+
security-events: write
43+
44+
strategy:
45+
fail-fast: false
46+
matrix:
47+
language: [ 'python' ]
48+
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
49+
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
50+
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
51+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
52+
53+
steps:
54+
- name: Checkout repository
55+
uses: actions/checkout@v3
56+
57+
# Initializes the CodeQL tools for scanning.
58+
- name: Initialize CodeQL
59+
uses: github/codeql-action/init@v2
60+
with:
61+
languages: ${{ matrix.language }}
62+
# If you wish to specify custom queries, you can do so here or in a config file.
63+
# By default, queries listed here will override any specified in a config file.
64+
# Prefix the list here with "+" to use these queries and those in the config file.
65+
66+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
67+
# queries: security-extended,security-and-quality
68+
69+
70+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
71+
# If this step fails, then you should remove it and run the build manually (see below)
72+
- name: Autobuild
73+
uses: github/codeql-action/autobuild@v2
74+
75+
# ℹ️ Command-line programs to run using the OS shell.
76+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
77+
78+
# If the Autobuild fails above, remove it and uncomment the following three lines.
79+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
80+
81+
# - run: |
82+
# echo "Run, Build Application using script"
83+
# ./location_of_script_within_repo/buildscript.sh
84+
85+
- name: Perform CodeQL Analysis
86+
uses: github/codeql-action/analyze@v2
87+
with:
88+
category: "/language:${{matrix.language}}"

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@ 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.2.0] - 2023-10-16
9+
10+
### Added
11+
12+
- CodeQL scanning via GitHub
13+
- Codecov.io coverage shield
14+
15+
### Changed
16+
17+
- Updated pypa/gh-action-pypi-publish from 1.8.8 to 1.8.10
18+
- Updated actions/checkout from 3 to 4
19+
- Mis-spelled `gotenerg_url` for a `Client` is now `host` and no longer keyword only
20+
821
## [0.1.0] - 2023-10-15
922

1023
### Added

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[![PyPI - Version](https://img.shields.io/pypi/v/gotenberg-client.svg)](https://pypi.org/project/gotenberg-client)
44
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/gotenberg-client.svg)](https://pypi.org/project/gotenberg-client)
5+
[![codecov](https://codecov.io/gh/stumpylog/gotenberg-client/graph/badge.svg?token=PH25G91Q6J)](https://codecov.io/gh/stumpylog/gotenberg-client)
56

67
---
78

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ dependencies = [
6565

6666
[tool.hatch.envs.default.scripts]
6767
version = "python3 --version"
68+
pip-list = "pip list"
6869
test = "pytest --pythonwarnings=all {args:tests}"
6970
test-cov = "coverage run -m pytest --pythonwarnings=all {args:tests}"
7071
cov-clear = "coverage erase"
@@ -76,13 +77,13 @@ cov-html = "coverage html"
7677
cov-json = "coverage json"
7778
cov = [
7879
"version",
80+
"pip-list",
7981
"cov-clear",
8082
"test-cov",
8183
"cov-report",
8284
"cov-json",
8385
"cov-html"
8486
]
85-
pip-list = "pip list"
8687

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

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.1.0"
4+
__version__ = "0.2.0"

src/gotenberg_client/_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ class GotenbergClient:
2424

2525
def __init__(
2626
self,
27+
host: str,
2728
*,
28-
gotenerg_url: str,
2929
timeout: float = 30.0,
3030
log_level: int = logging.ERROR,
3131
http2: bool = True,
3232
):
3333
# Configure the client
34-
self._client = Client(base_url=gotenerg_url, timeout=timeout, http2=http2)
34+
self._client = Client(base_url=host, timeout=timeout, http2=http2)
3535

3636
# Set the log level
3737
logging.getLogger("httpx").setLevel(log_level)

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@
2020

2121
@pytest.fixture()
2222
def client() -> GotenbergClient:
23-
with GotenbergClient(gotenerg_url=GOTENBERG_URL, log_level=logging.INFO) as client:
23+
with GotenbergClient(host=GOTENBERG_URL, log_level=logging.INFO) as client:
2424
yield client

tests/test_merge.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from tests.conftest import SAMPLE_DIR
1313
from tests.conftest import SAVE_DIR
1414
from tests.conftest import SAVE_OUTPUTS
15+
from tests.utils import call_run_with_server_error_handling
1516

1617

1718
@pytest.fixture()
@@ -41,7 +42,7 @@ def test_merge_files_pdf_a(
4142
pike_format: str,
4243
):
4344
with client.merge.merge() as route:
44-
resp = route.merge(create_files).pdf_format(gt_format).run()
45+
resp = call_run_with_server_error_handling(route.merge(create_files).pdf_format(gt_format))
4546

4647
assert resp.status_code == codes.OK
4748
assert "Content-Type" in resp.headers
@@ -63,7 +64,7 @@ def test_pdf_a_multiple_file(
6364
create_files: List[Path],
6465
):
6566
with client.merge.merge() as route:
66-
resp = route.merge(create_files).run()
67+
resp = call_run_with_server_error_handling(route.merge(create_files))
6768

6869
assert resp.status_code == codes.OK
6970
assert "Content-Type" in resp.headers

0 commit comments

Comments
 (0)