Skip to content

Commit fc556c0

Browse files
authored
Merge pull request #101 from intercreate/chore/switch-to-uv
build: switch to uv
2 parents 362d721 + dc82b15 commit fc556c0

51 files changed

Lines changed: 2722 additions & 3586 deletions

Some content is hidden

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

.coveragerc

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

.flake8

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

.githooks/pre-commit

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,4 @@
22

33
set -eo pipefail
44

5-
# lint
6-
poetry run black --check .
7-
poetry run isort --check-only .
8-
poetry run flake8 .
9-
poetry run mypy .
5+
uv run task fix

.github/workflows/lint.yaml

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

.github/workflows/release.yaml

Lines changed: 16 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,17 @@ on:
99

1010
jobs:
1111
build:
12-
name: Build distribution 📦
12+
name: Build distribution
1313
runs-on: ubuntu-latest
1414

1515
steps:
1616
- uses: actions/checkout@v4
17-
18-
- run: pipx install poetry
19-
20-
- name: Set up Python
21-
uses: actions/setup-python@v5
2217
with:
23-
python-version: "3.x"
24-
cache: "poetry"
25-
26-
- run: pipx inject poetry poetry-dynamic-versioning # https://github.com/python-poetry/poetry/issues/10028
27-
28-
- run: poetry install
18+
fetch-depth: 0
2919

30-
- name: Check for dirty state
31-
run: git status --porcelain
20+
- uses: astral-sh/setup-uv@v6
3221

33-
- name: Show pyproject.toml diff
34-
run: git diff pyproject.toml
35-
36-
- name: Undo any pyproject.toml changes
37-
run: git restore pyproject.toml
38-
39-
- run: poetry build
22+
- run: uv build
4023

4124
- name: Store the distribution packages
4225
uses: actions/upload-artifact@v4
@@ -45,7 +28,7 @@ jobs:
4528
path: dist/
4629

4730
publish-to-pypi:
48-
name: Publish Python 🐍 distribution 📦 to PyPI
31+
name: Publish to PyPI
4932
needs:
5033
- build
5134

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

5942
steps:
6043
- name: Download all the dists
6144
uses: actions/download-artifact@v4
6245
with:
6346
name: python-package-distributions
6447
path: dist/
65-
- name: Publish distribution 📦 to PyPI
48+
- name: Publish distribution to PyPI
6649
uses: pypa/gh-action-pypi-publish@release/v1
6750

6851
github-release:
69-
name: >-
70-
Sign the Python 🐍 distribution 📦 with Sigstore
71-
and upload them to GitHub Release
52+
name: Sign and upload to GitHub Release
7253
needs:
7354
- publish-to-pypi
7455
runs-on: ubuntu-latest
7556

7657
permissions:
77-
contents: write # IMPORTANT: mandatory for making GitHub Releases
78-
id-token: write # IMPORTANT: mandatory for sigstore
58+
contents: write
59+
id-token: write
7960

8061
steps:
8162
- name: Download all the dists
@@ -91,26 +72,20 @@ jobs:
9172
./dist/*.whl
9273
9374
publish-docs:
94-
name: Publish documentation 📚 to GitHub Pages
75+
name: Publish documentation to GitHub Pages
9576
needs:
9677
- github-release
9778
runs-on: ubuntu-latest
9879

9980
permissions:
100-
contents: write # IMPORTANT: mandatory for deploying to GitHub Pages
81+
contents: write
10182

10283
steps:
10384
- uses: actions/checkout@v4
104-
105-
- run: pipx install poetry
106-
107-
- name: Set up Python
108-
uses: actions/setup-python@v5
10985
with:
110-
python-version: "3.x"
111-
cache: "poetry"
86+
fetch-depth: 0
11287

113-
- run: poetry install --only doc
88+
- uses: astral-sh/setup-uv@v6
11489

11590
- name: Configure git for gh-pages
11691
run: |
@@ -122,5 +97,5 @@ jobs:
12297

12398
- name: Build and deploy documentation
12499
run: |
125-
poetry run python docs/_generate_requests_docstrings.py
126-
poetry run mike deploy --push --update-aliases ${GIT_TAG} latest
100+
uv run --group doc python docs/_generate_requests_docstrings.py
101+
uv run --group doc mike deploy --push --update-aliases ${GIT_TAG} latest

.github/workflows/test-docs.yaml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,12 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v4
13-
14-
- name: Install poetry
15-
run: pipx install poetry
16-
17-
- uses: actions/setup-python@v5
1813
with:
19-
python-version: "3.x"
20-
cache: "poetry"
14+
fetch-depth: 0
2115

22-
- run: poetry install --only doc
16+
- uses: astral-sh/setup-uv@v6
2317

2418
- name: Build docs
2519
run: |
26-
poetry run python docs/_generate_requests_docstrings.py
27-
poetry run mkdocs build
20+
uv run --group doc python docs/_generate_requests_docstrings.py
21+
uv run --group doc mkdocs build

.github/workflows/test.yaml

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,45 @@
1-
name: Test
1+
name: CI
2+
23
on:
34
push:
45
branches: [main]
56
pull_request:
6-
branches: [main]
7+
workflow_dispatch:
78

89
jobs:
9-
tests:
10+
lint-and-test:
1011
strategy:
1112
matrix:
13+
os: [ubuntu-latest, macos-latest, windows-latest, ubuntu-24.04-arm]
1214
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
13-
os: [ubuntu-latest, windows-latest, macos-latest]
1415
runs-on: ${{ matrix.os }}
15-
1616
steps:
1717
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
1820

19-
- run: pipx install poetry
21+
- uses: astral-sh/setup-uv@v6
2022

21-
- name: Setup Python ${{ matrix.python-version }}
22-
uses: actions/setup-python@v5
23-
with:
24-
python-version: ${{ matrix.python-version }}
25-
cache: "poetry"
23+
- run: uv run --python ${{ matrix.python-version }} task lint
24+
25+
- run: uv run --python ${{ matrix.python-version }} task typecheck
2626

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

29-
- run: poetry install
29+
- run: uv build
30+
31+
- uses: actions/upload-artifact@v4
32+
with:
33+
name: dist-${{ matrix.os }}-${{ matrix.python-version }}
34+
path: |
35+
dist/*.tar.gz
36+
dist/*.whl
37+
38+
coverage:
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v4
3042

31-
- name: Test (Linux or MacOS)
32-
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
33-
run: |
34-
shopt -s expand_aliases
35-
. ./envr.ps1
36-
test
43+
- uses: astral-sh/setup-uv@v6
3744

38-
- name: Test (Windows)
39-
if: matrix.os == 'windows-latest'
40-
run: |
41-
. ./envr.ps1
42-
test
45+
- run: uv run task coverage

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
.venv
1+
.venv*
22
__pycache__
33
.coverage
44
.mypy_cache
55
.pytest_cache
66
dist
7-
.tox
87
site
9-
.poetry
8+
coverage.xml

.python-version

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
3.14
2+
3.13
3+
3.12
4+
3.11
5+
3.10

.vscode/extensions.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
{
22
"recommendations": [
3-
"ms-python.black-formatter",
4-
"ms-python.isort",
5-
"ms-python.flake8",
6-
"ms-python.mypy-type-checker",
7-
"ms-python.python"
3+
"ms-python.python",
4+
"charliermarsh.ruff",
5+
"ms-python.mypy-type-checker"
86
]
9-
}
7+
}

0 commit comments

Comments
 (0)