Skip to content

Commit 2e92747

Browse files
authored
feat: Update client builder
2 parents e4e4a12 + f35e821 commit 2e92747

File tree

2,001 files changed

+14778
-53288
lines changed

Some content is hidden

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

2,001 files changed

+14778
-53288
lines changed

.commitlintrc.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# SPDX-FileCopyrightText: Copyright DB InfraGO AG
2+
# SPDX-License-Identifier: CC0-1.0
3+
4+
extends:
5+
- '@commitlint/config-conventional'
6+
rules:
7+
body-leading-blank: [2, always]
8+
footer-leading-blank: [2, always]
9+
scope-case: [2, always, lower-case]
10+
subject-case: [2, always, sentence-case]
11+
subject-empty: [2, never]
12+
subject-full-stop: [2, never, .]
13+
subject-max-length: [2, always, 72]
14+
type-empty: [2, never]
15+
type-enum: [2, always, [
16+
build,
17+
chore,
18+
ci,
19+
docs,
20+
feat,
21+
fix,
22+
merge,
23+
perf,
24+
refactor,
25+
revert,
26+
test,
27+
]]

.github/workflows/build-test-publish.yml

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@
44
name: Build
55

66
on:
7+
pull_request:
78
push:
89
branches: ["*"]
9-
pull_request: [main]
1010
tags: ["v*.*.*"]
11+
workflow_dispatch:
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref_type == 'tag' && github.sha || '0' }}
15+
cancel-in-progress: true
1116

1217
jobs:
1318
test:
@@ -21,55 +26,58 @@ jobs:
2126
- "3.10"
2227
- "3.11"
2328
- "3.12"
29+
- "3.13"
2430
include:
2531
- os: windows-latest
2632
python_version: "3.12"
2733
steps:
2834
- uses: actions/checkout@v4
29-
- name: Set up Python ${{matrix.python_version}}
30-
uses: actions/setup-python@v5
35+
- uses: astral-sh/setup-uv@v5
3136
with:
37+
enable-cache: true
38+
cache-dependency-glob: "**/pyproject.toml"
3239
python-version: ${{matrix.python_version}}
33-
- uses: actions/cache@v4
34-
with:
35-
path: ~/.cache/pip
36-
key: ${{runner.os}}-pip-${{hashFiles('pyproject.toml')}}
37-
restore-keys: |
38-
${{runner.os}}-pip-
39-
${{runner.os}}-
40-
- name: Upgrade Pip
41-
run: |-
42-
python -m pip install -U pip
43-
- name: Install test dependencies
44-
run: |-
45-
python -m pip install '.[test]'
4640
- name: Run unit tests
47-
run: |-
48-
python -m pytest --cov-report=term --cov=polarion_rest_api_client --rootdir=.
41+
run: uv run coverage run
42+
- name: Report coverage
43+
if: always()
44+
run: uv run coverage report
45+
46+
pre-commit:
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v4
50+
with:
51+
fetch-depth: 0
52+
- uses: astral-sh/setup-uv@v6
53+
with:
54+
enable-cache: true
55+
cache-dependency-glob: "**/pyproject.toml"
56+
python-version: "3.13"
57+
- name: Run Pre-Commit
58+
run: uv run pre-commit run --all-files
59+
4960
build:
5061
name: Build wheel
5162
runs-on: ubuntu-latest
5263
steps:
5364
- uses: actions/checkout@v4
5465
with:
5566
fetch-depth: 0
56-
- name: Setup Python
57-
uses: actions/setup-python@v5
67+
- uses: astral-sh/setup-uv@v6
5868
with:
59-
cache: pip
60-
cache-dependency-path: pyproject.toml
61-
python-version: "3.12"
62-
- name: Install dependencies
63-
run: python -m pip install -U pip build twine
69+
enable-cache: true
70+
cache-dependency-glob: "**/pyproject.toml"
71+
python-version: "3.13"
6472
- name: Build packages
65-
run: python -m build
73+
run: uv build --no-sources
6674
- name: Verify packages
67-
run: python -m twine check dist/*
75+
run: uvx twine check dist/*
6876
- name: Upload artifacts
6977
uses: actions/upload-artifact@v4
7078
with:
7179
name: python-package-distributions
72-
path: dist/
80+
path: 'dist/*'
7381
if-no-files-found: error
7482
pypi:
7583
name: Publish to PyPI

.github/workflows/docs.yml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
name: Docs
55

66
on:
7+
pull_request:
78
push:
89
branches: ["main"]
10+
workflow_dispatch:
911

1012
jobs:
1113
sphinx:
@@ -16,23 +18,25 @@ jobs:
1618
- uses: actions/checkout@v4
1719
with:
1820
fetch-depth: 0
19-
- uses: actions/setup-python@v5
21+
- uses: astral-sh/setup-uv@v6
2022
with:
23+
enable-cache: true
24+
cache-dependency-glob: "**/pyproject.toml"
2125
python-version: "3.12"
22-
- name: Upgrade pip
23-
run: |
24-
python -m pip install -U pip
25-
- name: Install dependencies
26-
run: |
27-
python -m pip install '.[docs]'
28-
- name: Auto-generate APIDOC sources
29-
run: |-
30-
sphinx-apidoc --output-dir docs/source/code --force . polarion_rest_api_client/open_api_client
26+
- name: Install system-level dependencies
27+
run: sudo apt-get install -y pandoc
3128
- name: Create docs
32-
run: |
33-
make -C docs html
29+
run: make -C docs html
30+
- name: Upload built docs as artifact
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: Documentation
34+
path: docs/build/html
35+
if-no-files-found: error
36+
retention-days: 5
3437
- name: Deploy
35-
uses: peaceiris/actions-gh-pages@v3
38+
if: github.ref == 'refs/heads/main'
39+
uses: peaceiris/actions-gh-pages@v4
3640
with:
3741
force_orphan: true
3842
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/lint.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

.gitignore

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# Byte-compiled / optimized / DLL files
55
__pycache__/
6-
*.py[cod]
6+
*.py[codz]
77
*$py.class
88

99
# C extensions
@@ -52,7 +52,7 @@ htmlcov/
5252
nosetests.xml
5353
coverage.xml
5454
*.cover
55-
*.py,cover
55+
*.py.cover
5656
.hypothesis/
5757
.pytest_cache/
5858
cover/
@@ -102,20 +102,35 @@ ipython_config.py
102102
# install all needed dependencies.
103103
#Pipfile.lock
104104

105+
# UV
106+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
107+
# This is especially recommended for binary packages to ensure reproducibility, and is more
108+
# commonly ignored for libraries.
109+
uv.lock
110+
105111
# poetry
106112
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
107113
# This is especially recommended for binary packages to ensure reproducibility, and is more
108114
# commonly ignored for libraries.
109115
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
110116
#poetry.lock
117+
#poetry.toml
111118

112119
# pdm
113120
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
121+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
122+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
114123
#pdm.lock
115-
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
116-
# in version control.
117-
# https://pdm.fming.dev/#use-with-ide
118-
.pdm.toml
124+
#pdm.toml
125+
.pdm-python
126+
.pdm-build/
127+
128+
# pixi
129+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
130+
#pixi.lock
131+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
132+
# in the .venv directory. It is recommended not to include this directory in version control.
133+
.pixi
119134

120135
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121136
__pypackages__/
@@ -129,6 +144,7 @@ celerybeat.pid
129144

130145
# Environments
131146
.env
147+
.envrc
132148
.venv
133149
env/
134150
venv/
@@ -140,9 +156,6 @@ venv.bak/
140156
.spyderproject
141157
.spyproject
142158

143-
# VS Code settings
144-
.vscode/
145-
146159
# Rope project settings
147160
.ropeproject
148161

@@ -162,3 +175,9 @@ dmypy.json
162175

163176
# Cython debug symbols
164177
cython_debug/
178+
179+
# Ruff stuff:
180+
.ruff_cache/
181+
182+
# PyPI configuration file
183+
.pypirc

0 commit comments

Comments
 (0)