Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .coveragerc

This file was deleted.

10 changes: 0 additions & 10 deletions .flake8

This file was deleted.

6 changes: 1 addition & 5 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,4 @@

set -eo pipefail

# lint
poetry run black --check .
poetry run isort --check-only .
poetry run flake8 .
poetry run mypy .
uv run task fix
30 changes: 0 additions & 30 deletions .github/workflows/lint.yaml

This file was deleted.

57 changes: 16 additions & 41 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,17 @@ on:

jobs:
build:
name: Build distribution 📦
name: Build distribution
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- run: pipx install poetry

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
cache: "poetry"

- run: pipx inject poetry poetry-dynamic-versioning # https://github.com/python-poetry/poetry/issues/10028

- run: poetry install
fetch-depth: 0

- name: Check for dirty state
run: git status --porcelain
- uses: astral-sh/setup-uv@v6

- name: Show pyproject.toml diff
run: git diff pyproject.toml

- name: Undo any pyproject.toml changes
run: git restore pyproject.toml

- run: poetry build
- run: uv build

- name: Store the distribution packages
uses: actions/upload-artifact@v4
Expand All @@ -45,7 +28,7 @@ jobs:
path: dist/

publish-to-pypi:
name: Publish Python 🐍 distribution 📦 to PyPI
name: Publish to PyPI
needs:
- build

Expand All @@ -54,28 +37,26 @@ jobs:
name: pypi
url: https://pypi.org/p/${{ env.name }}
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
id-token: write

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

github-release:
name: >-
Sign the Python 🐍 distribution 📦 with Sigstore
and upload them to GitHub Release
name: Sign and upload to GitHub Release
needs:
- publish-to-pypi
runs-on: ubuntu-latest

permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore
contents: write
id-token: write

steps:
- name: Download all the dists
Expand All @@ -91,26 +72,20 @@ jobs:
./dist/*.whl

publish-docs:
name: Publish documentation 📚 to GitHub Pages
name: Publish documentation to GitHub Pages
needs:
- github-release
runs-on: ubuntu-latest

permissions:
contents: write # IMPORTANT: mandatory for deploying to GitHub Pages
contents: write

steps:
- uses: actions/checkout@v4

- run: pipx install poetry

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
cache: "poetry"
fetch-depth: 0

- run: poetry install --only doc
- uses: astral-sh/setup-uv@v6

- name: Configure git for gh-pages
run: |
Expand All @@ -122,5 +97,5 @@ jobs:

- name: Build and deploy documentation
run: |
poetry run python docs/_generate_requests_docstrings.py
poetry run mike deploy --push --update-aliases ${GIT_TAG} latest
uv run --group doc python docs/_generate_requests_docstrings.py
uv run --group doc mike deploy --push --update-aliases ${GIT_TAG} latest
14 changes: 4 additions & 10 deletions .github/workflows/test-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

- uses: actions/setup-python@v5
with:
python-version: "3.x"
cache: "poetry"
fetch-depth: 0

- run: poetry install --only doc
- uses: astral-sh/setup-uv@v6

- name: Build docs
run: |
poetry run python docs/_generate_requests_docstrings.py
poetry run mkdocs build
uv run --group doc python docs/_generate_requests_docstrings.py
uv run --group doc mkdocs build
51 changes: 27 additions & 24 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,42 +1,45 @@
name: Test
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

jobs:
tests:
lint-and-test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest, ubuntu-24.04-arm]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- run: pipx install poetry
- uses: astral-sh/setup-uv@v6

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- run: uv run --python ${{ matrix.python-version }} task lint

- run: uv run --python ${{ matrix.python-version }} task typecheck

- run: pipx inject poetry poetry-dynamic-versioning # https://github.com/python-poetry/poetry/issues/10028
- run: uv run --python ${{ matrix.python-version }} task test

- run: poetry install
- run: uv build

- uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.os }}-${{ matrix.python-version }}
path: |
dist/*.tar.gz
dist/*.whl

coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Test (Linux or MacOS)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
run: |
shopt -s expand_aliases
. ./envr.ps1
test
- uses: astral-sh/setup-uv@v6

- name: Test (Windows)
if: matrix.os == 'windows-latest'
run: |
. ./envr.ps1
test
- run: uv run task coverage
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
.venv
.venv*
__pycache__
.coverage
.mypy_cache
.pytest_cache
dist
.tox
site
.poetry
coverage.xml
5 changes: 5 additions & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
3.14
3.13
3.12
3.11
3.10
10 changes: 4 additions & 6 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"recommendations": [
"ms-python.black-formatter",
"ms-python.isort",
"ms-python.flake8",
"ms-python.mypy-type-checker",
"ms-python.python"
"ms-python.python",
"charliermarsh.ruff",
"ms-python.mypy-type-checker"
]
}
}
20 changes: 9 additions & 11 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
{
"flake8.args": ["--config=.flake8"],
"[python]": {
"diffEditor.ignoreTrimWhitespace": false,
"editor.formatOnType": true,
"editor.wordBasedSuggestions": "off",
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true,
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.codeActionsOnSave": {
"source.organizeImports.isort": "explicit"
},
"source.organizeImports": "always"
}
},
"python.testing.pytestArgs": [
"tests"
],
"flake8.enabled": false,
"ruff.enable": true,
"ruff.lint.enable": true,
"mypy-type-checker.importStrategy": "fromEnvironment",
"python.testing.pytestArgs": ["tests"],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.testing.pytestEnabled": true
}
Loading