Skip to content

Commit da28691

Browse files
committed
build: switch build system from poetry to uv
1 parent ac196e5 commit da28691

7 files changed

Lines changed: 2716 additions & 3219 deletions

File tree

.flake8

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[flake8]
2+
ignore = E203, E501, W503
3+
inline-quotes = double
4+
max-line-length = 80
5+
select = B,C,E,F,W,T4,B9

.github/workflows/ci.yml

Lines changed: 21 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,17 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v4
1818

19-
- name: Install python
20-
uses: actions/setup-python@v5
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v5
2121
with:
22+
enable-cache: true
2223
python-version: "3.12"
2324

24-
- name: Install poetry
25-
run: pipx install poetry
26-
2725
- name: Install package
28-
run: poetry install
26+
run: uv sync --group dev
2927

3028
- name: Run linters
31-
run: poetry run pre-commit run -a
29+
run: uv run pre-commit run -a
3230

3331
test:
3432
name: Python ${{ matrix.python-version }} (${{ matrix.platform }})
@@ -41,57 +39,40 @@ jobs:
4139
include:
4240
- python-version: "3.10"
4341
platform: ubuntu-latest
44-
toxenv: py310
4542
- python-version: "3.11"
4643
platform: ubuntu-latest
47-
toxenv: py311
4844
- python-version: "3.12"
4945
platform: ubuntu-latest
50-
toxenv: py312
5146
- python-version: "3.13"
5247
platform: ubuntu-latest
53-
toxenv: py313
5448
- python-version: "3.14"
5549
platform: ubuntu-latest
56-
toxenv: py314
5750
- python-version: "3.12"
5851
platform: macos-latest
59-
toxenv: py312
6052
- python-version: "3.12"
6153
platform: windows-latest
62-
toxenv: py312
6354

6455
steps:
6556
- uses: actions/checkout@v4
6657

67-
- name: Install python ${{ matrix.python-version }}
68-
id: setup-python
69-
uses: actions/setup-python@v5
58+
- name: Install uv
59+
uses: astral-sh/setup-uv@v5
7060
with:
61+
enable-cache: true
7162
python-version: ${{ matrix.python-version }}
7263

73-
- name: Export PIPX_DEFAULT_PYTHON
74-
shell: bash
75-
run: echo "PIPX_DEFAULT_PYTHON=${{ steps.setup-python.outputs.python-path }}" >> $GITHUB_ENV
76-
77-
- name: Install poetry
78-
run: pipx install poetry
79-
80-
- name: Install tox
81-
run: pipx install tox
82-
83-
- name: Install package
84-
run: poetry install
64+
- name: Install dependencies
65+
run: uv sync --group dev
8566

8667
- name: Run tests
87-
run: tox -e ${{ matrix.toxenv }}
68+
run: uv run pytest --cache-clear --cov=src --cov-config=pyproject.toml --cov-report=term-missing --disable-pytest-warnings
8869

8970
- name: Run codecov
9071
env:
91-
CODECOV_TOKEN:
92-
${{ secrets.CODECOV_TOKEN }}
93-
run: tox -e codecov
94-
72+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
73+
run: |
74+
uv run coverage xml --ignore-errors
75+
uv run codecov upload-process
9576
9677
release:
9778
runs-on: ubuntu-latest
@@ -103,23 +84,20 @@ jobs:
10384
with:
10485
fetch-depth: 0
10586

106-
- name: Install python
107-
uses: actions/setup-python@v5
87+
- name: Install uv
88+
uses: astral-sh/setup-uv@v5
10889
with:
90+
enable-cache: true
10991
python-version: "3.12"
11092

111-
- name: Install poetry
112-
run: pipx install poetry
113-
11493
- name: Install package
115-
run: poetry install
94+
run: uv sync --group dev
11695

11796
- name: Run semantic-release
11897
env:
11998
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12099
run: |
121100
git config --global user.email "bugmon@mozilla.com"
122101
git config --global user.name "semantic-release"
123-
poetry run semantic-release -v version --no-changelog
124-
poetry run semantic-release publish
125-
102+
uv run semantic-release -v version --no-changelog
103+
uv run semantic-release publish

.pre-commit-config.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,35 @@ repos:
44
hooks:
55
- id: black
66
name: black
7-
entry: poetry run black --check --diff
7+
entry: uv run black --check --diff
88
language: system
99
types: [ python ]
1010
- id: flake8
1111
name: flake8
12-
entry: poetry run flake8
12+
entry: uv run flake8
1313
language: system
1414
types: [ python ]
1515
require_serial: true
1616
- id: gitlint
1717
name: gitlint
18-
entry: poetry run gitlint
18+
entry: uv run gitlint
1919
language: system
2020
args: [--contrib=contrib-title-conventional-commits, --ignore=body-is-missing, --msg-filename]
2121
stages: [commit-msg]
2222
- id: mypy
2323
name: mypy
24-
entry: poetry run mypy src
24+
entry: uv run mypy src
2525
language: system
2626
pass_filenames: false
2727
types: [ python ]
2828
- id: pylint
2929
name: pylint
30-
entry: poetry run pylint -j 0 src
30+
entry: uv run pylint -j 0 src
3131
language: system
3232
pass_filenames: false
3333
types: [ python ]
34-
- id: toml-sort
35-
name: toml-sort
36-
entry: poetry run toml-sort --check -a
34+
- id: pyproject-fmt
35+
name: pyproject-fmt
36+
entry: uv run pyproject-fmt --check
3737
files: "^pyproject\\.toml$"
3838
language: system

0 commit comments

Comments
 (0)