Skip to content

Commit 942f1ad

Browse files
committed
chore: migrate to uv
1 parent 5f41c7b commit 942f1ad

5 files changed

Lines changed: 976 additions & 1259 deletions

File tree

.github/workflows/tests.yaml

Lines changed: 30 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,14 @@ jobs:
2525
- '3.9'
2626
steps:
2727
- uses: actions/checkout@v4
28-
- name: Install Poetry
29-
uses: snok/install-poetry@v1
30-
- uses: actions/setup-python@v5
28+
- name: Install uv
29+
uses: astral-sh/setup-uv@v3
3130
with:
32-
python-version: ${{ matrix.python }}
33-
cache: 'poetry'
34-
- name: Install dependencies and run tests
35-
run: |
36-
poetry --version
37-
poetry install
38-
poetry run pytest --showlocals
31+
enable-cache: true
32+
- name: Install Python ${{ matrix.python }}
33+
run: uv python install ${{ matrix.python }}
34+
- name: Run tests
35+
run: uv run pytest --showlocals
3936

4037
downstream-tests:
4138
name: py${{ matrix.python }} ${{ matrix.downstream }} downstream unit tests
@@ -53,51 +50,44 @@ jobs:
5350
- scim2-cli
5451
- scim2-tester
5552
steps:
56-
- uses: actions/checkout@v4
57-
- name: Install Poetry
58-
uses: snok/install-poetry@v1
59-
- uses: actions/setup-python@v5
53+
- name: Checkout upstream pyproject
54+
uses: actions/checkout@v4
55+
- name: Install uv
56+
uses: astral-sh/setup-uv@v3
6057
with:
61-
python-version: ${{ matrix.python }}
62-
cache: 'poetry'
63-
- name: Install dependencies
64-
run: |
65-
poetry --version
66-
poetry install
58+
enable-cache: true
6759
- name: Checkout downstream pyproject
6860
uses: actions/checkout@v4
6961
with:
7062
repository: yaal-coop/${{ matrix.downstream }}
7163
path: ${{ matrix.downstream }}
64+
- name: Install Python ${{ matrix.python }}
65+
run: |
66+
cd ${{ matrix.downstream }}
67+
uv python install ${{ matrix.python }}
7268
- name: Install downstream test environment
7369
run: |
7470
cd ${{ matrix.downstream }}
75-
poetry install --with dev
76-
poetry run pip install --upgrade --force ..
71+
uv sync
72+
uv pip install --upgrade --force-reinstall ..
7773
- name: Run downstream tests
7874
run: |
7975
cd ${{ matrix.downstream }}
80-
poetry run pytest --showlocals
76+
uv run pytest --showlocals
8177
8278
minversions:
8379
name: minimum dependency versions
8480
runs-on: ubuntu-latest
8581
steps:
8682
- uses: actions/checkout@v4
87-
- name: Install Poetry
88-
uses: snok/install-poetry@v1
89-
- uses: actions/setup-python@v5
83+
- name: Install uv
84+
uses: astral-sh/setup-uv@v3
9085
with:
91-
python-version: '3.9'
92-
cache: 'poetry'
93-
- run: sed -i -E 's/"(\^|>=)([0-9\.]+)([^,]*)"/"==\2"/' pyproject.toml
94-
- run: sed -i -E 's/python = "==/python = "^/' pyproject.toml
95-
- name: Install dependencies and run tests
96-
run: |
97-
poetry --version
98-
poetry lock
99-
poetry install
100-
poetry run pytest --showlocals
86+
enable-cache: true
87+
- name: Install minimum dependencies
88+
run: uv sync --resolution=lowest-direct
89+
- name: Run tests
90+
run: uv run pytest --showlocals
10191

10292
style:
10393
runs-on: ubuntu-latest
@@ -109,12 +99,8 @@ jobs:
10999
runs-on: ubuntu-latest
110100
steps:
111101
- uses: actions/checkout@v4
112-
- name: Install Poetry
113-
uses: snok/install-poetry@v1
114-
- uses: actions/setup-python@v5
102+
- name: Install uv
103+
uses: astral-sh/setup-uv@v3
115104
with:
116-
python-version: '3.12'
117-
cache: 'poetry'
118-
- run: |
119-
poetry install --with doc
120-
poetry run sphinx-build doc build/sphinx/html
105+
enable-cache: true
106+
- run: uv run sphinx-build doc build/sphinx/html

doc/contributing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ the `bugtracker <https://github.com/yaal-coop/scim2-models/issues>`_.
1414
Unit tests
1515
----------
1616

17-
To run the tests, you just can run `poetry run pytest` and/or `tox` to test all the supported python environments.
17+
To run the tests, you just can run `uv run pytest` and/or `tox` to test all the supported python environments.
1818
Everything must be green before patches get merged.
1919

2020
The test coverage is 100%, patches won't be accepted if not entirely covered. You can check the
21-
test coverage with ``poetry run pytest --cov --cov-report=html`` or ``tox -e coverage -- --cov-report=html``.
21+
test coverage with ``uv run pytest --cov --cov-report=html`` or ``tox -e coverage -- --cov-report=html``.
2222
You can check the HTML coverage report in the newly created `htmlcov` directory.
2323

2424
Code style

0 commit comments

Comments
 (0)