Skip to content

Commit 529992f

Browse files
authored
Migrate python from poetry to uv (#493)
2 parents 35b633e + 35fa9fb commit 529992f

28 files changed

+1294
-1446
lines changed

.github/workflows/python-ci.yml

+10-20
Original file line numberDiff line numberDiff line change
@@ -18,41 +18,31 @@ jobs:
1818
steps:
1919
- name: Checkout
2020
uses: actions/checkout@v4
21-
- run: pipx install poetry
2221
- name: Set up Python
23-
uses: actions/setup-python@v5
22+
uses: astral-sh/setup-uv@v4
2423
with:
2524
python-version: ${{ matrix.python-version }}
26-
cache: "poetry"
27-
- name: selfie-lib - poetry install
28-
run: poetry install
29-
working-directory: python/selfie-lib
25+
enable-cache: true
3026
- name: selfie-lib - pytest
31-
run: poetry run pytest -vv
27+
run: uv run pytest -vv
3228
working-directory: python/selfie-lib
3329
- name: selfie-lib - pyright
34-
run: poetry run pyright
30+
run: uv run pyright
3531
working-directory: python/selfie-lib
3632
- name: selfie-lib - ruff
37-
run: poetry run ruff format --check && poetry run ruff check
33+
run: uv run ruff format --check && uv run ruff check
3834
working-directory: python/selfie-lib
39-
- name: pytest-selfie - poetry install
40-
run: poetry install
41-
working-directory: python/pytest-selfie
4235
- name: pytest-selfie - pyright
43-
run: poetry run pyright
36+
run: uv run pyright
4437
working-directory: python/pytest-selfie
4538
- name: pytest-selfie - ruff
46-
run: poetry run ruff format --check && poetry run ruff check
39+
run: uv run ruff format --check && uv run ruff check
4740
working-directory: python/pytest-selfie
48-
- name: example-pytest-selfie - poetry install
49-
run: poetry install
50-
working-directory: python/example-pytest-selfie
51-
- run: poetry run pytest -vv
41+
- run: uv run pytest -vv
5242
working-directory: python/example-pytest-selfie
5343
- name: example-pytest-selfie - pyright
54-
run: poetry run pyright
44+
run: uv run pyright
5545
working-directory: python/example-pytest-selfie
5646
- name: example-pytest-selfie - ruff
57-
run: poetry run ruff format --check && poetry run ruff check
47+
run: uv run ruff format --check && uv run ruff check
5848
working-directory: python/example-pytest-selfie

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ __pycache__/
88
dist/
99
python/html/
1010
python/latex/
11+
python/selfie-lib/selfie_lib.egg-info/
12+
python/pytest-selfie/pytest_selfie.egg-info/
1113
node_modules/

python/README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44

55
## Contributing
66

7-
Dependencies are managed using poetry:
7+
Dependencies are managed using uv:
88

9-
- https://python-poetry.org/docs/#installing-with-the-official-installer
10-
- then cd into `selfie-lib` and run `poetry install`
9+
- https://docs.astral.sh/uv/getting-started/installation/
10+
- then cd into `selfie-lib` and run `uv sync` to get the dependencies
1111

1212
Our CI server runs three checks in the `selfie-lib` directory.
1313

14-
- `poetry run pytest` - run tests
15-
- `poetry run pyright` - type checking
16-
- `poetry run ruff format --check && poetry run ruff check` - code lint & formatting
17-
- `poetry run ruff format && poetry run ruff check --fix` to fix
14+
- `uv run pytest` - run tests
15+
- `uv run pyright` - type checking
16+
- `uv run ruff format --check && uv run ruff check` - code lint & formatting
17+
- `uv run ruff format && uv run ruff check --fix` to fix
1818

1919
The same setup is used for `pytest-selfie` and `example-pytest-selfie`.
2020

python/example-pytest-selfie/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ The purpose of this project is to demonstrate selfie for the manual.
22

33
Go to https://selfie.dev/py/facets for the tutorial.
44

5-
- First run `poetry install`
6-
- You can run the app locally with `poetry run python app.py`
7-
- You can run the tests with `poetry run pytest`
5+
- First run `uv sync`
6+
- You can run the app locally with `uv run python app.py`
7+
- You can run the tests with `uv run pytest`

0 commit comments

Comments
 (0)