Skip to content

Commit c005f8d

Browse files
committed
Migrate to uv
1 parent 6fce55c commit c005f8d

File tree

10 files changed

+5239
-10272
lines changed

10 files changed

+5239
-10272
lines changed

.github/workflows/code_checks.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
name: code checks
2+
permissions:
3+
contents: read
4+
pull-requests: write
25

36
on:
47
push:
@@ -9,7 +12,7 @@ on:
912
- .github/workflows/code_checks.yml
1013
- .github/workflows/integration_tests.yml
1114
- '**.py'
12-
- poetry.lock
15+
- uv.lock
1316
- pyproject.toml
1417
- '**.ipynb'
1518
pull_request:
@@ -19,7 +22,7 @@ on:
1922
- .pre-commit-config.yaml
2023
- .github/workflows/code_checks.yml
2124
- '**.py'
22-
- poetry.lock
25+
- uv.lock
2326
- pyproject.toml
2427
- '**.ipynb'
2528

@@ -28,20 +31,21 @@ jobs:
2831
runs-on: ubuntu-latest
2932
steps:
3033
- uses: actions/[email protected]
31-
- name: Install and configure Poetry
32-
uses: snok/install-poetry@v1
34+
- name: Install uv
35+
uses: astral-sh/setup-uv@4db96194c378173c656ce18a155ffc14a9fc4355
3336
with:
34-
virtualenvs-create: true
35-
virtualenvs-in-project: true
36-
- uses: actions/[email protected]
37+
# Install a specific version of uv.
38+
version: "0.5.21"
39+
enable-cache: true
40+
- name: "Set up Python"
41+
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38
3742
with:
38-
python-version: '3.10'
39-
cache: 'poetry'
43+
python-version-file: ".python-version"
44+
- name: Install the project
45+
run: uv sync --dev
4046
- name: Install dependencies and check code
4147
run: |
42-
poetry env use '3.10'
4348
source .venv/bin/activate
44-
poetry install --with test --all-extras
4549
pre-commit run --all-files
4650
- name: pip-audit (gh-action-pip-audit)
4751
uses: pypa/[email protected]

.github/workflows/docs.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
name: docs
2+
permissions:
3+
contents: read
4+
pull-requests: write
25

36
on:
47
pull_request:
@@ -14,22 +17,27 @@ jobs:
1417
submodules: 'true'
1518
fetch-depth: 0
1619

17-
- name: Install poetry
18-
run: python3 -m pip install --upgrade pip && python3 -m pip install poetry
19-
20-
- uses: actions/[email protected]
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@4db96194c378173c656ce18a155ffc14a9fc4355
2122
with:
22-
python-version: '3.10'
23-
cache: 'poetry'
23+
# Install a specific version of uv.
24+
version: "0.5.21"
25+
enable-cache: true
2426

25-
- name: Install dependencies
27+
- name: "Set up Python"
28+
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38
29+
with:
30+
python-version-file: ".python-version"
31+
- name: Install the project
32+
run: uv sync --dev --group docs
33+
- name: Install dependencies and check code
2634
run: |
27-
poetry env use '3.10'
28-
poetry install --with docs,test --all-extras
35+
source .venv/bin/activate
36+
pre-commit run --all-files
2937
3038
- name: Build docs
3139
run: |
32-
source $(poetry env info --path)/bin/activate
40+
source .venv/bin/activate
3341
cd docs
3442
rm -rf source/reference/api/_autosummary
3543
if [[ "${{ github.event_name == 'pull_request' && github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release') }}" == "true" ]]; then

.github/workflows/integration_tests.yml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
- '**.html'
1414
- '**.jinja'
1515
- '**.js'
16-
- poetry.lock
16+
- uv.lock
1717
- pyproject.toml
1818
- '**.rst'
1919
- '**.md'
@@ -30,7 +30,7 @@ on:
3030
- '**.html'
3131
- '**.jinja'
3232
- '**.js'
33-
- poetry.lock
33+
- uv.lock
3434
- pyproject.toml
3535
- '**.rst'
3636
- '**.md'
@@ -41,20 +41,23 @@ jobs:
4141
runs-on: [self-hosted, gpu, db, cyclops]
4242
steps:
4343
- uses: actions/[email protected]
44-
- name: Install poetry
45-
run: python3 -m pip install --upgrade pip && python3 -m pip install poetry
46-
- uses: actions/[email protected]
44+
- name: Install uv
45+
uses: astral-sh/setup-uv@4db96194c378173c656ce18a155ffc14a9fc4355
4746
with:
48-
python-version: '3.10'
49-
cache: 'poetry'
50-
- name: Install dependencies and check code
47+
# Install a specific version of uv.
48+
version: "0.5.21"
49+
enable-cache: true
50+
- name: "Set up Python"
51+
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38
52+
with:
53+
python-version-file: ".python-version"
54+
- name: Install project and check code
5155
run: |
5256
export PATH=/opt/openmpi-4.1.5/bin:$PATH
5357
export LD_LIBRARY_PATH=/opt/openmpi-4.1.5/lib:$LD_LIBRARY_PATH
5458
ompi_info
55-
poetry env use '3.10'
56-
source $(poetry env info --path)/bin/activate
57-
env MPICC=/opt/openmpi-4.1.5/bin/mpicc poetry install --with dev,test --all-extras
59+
env MPICC=/opt/openmpi-4.1.5/bin/mpicc uv sync --all-extras --dev --group test
60+
source .venv/bin/activate
5861
mpirun -n 2 python -m pytest --only-mpi
5962
pytest -m integration_test --cov-report term --cov-report xml:./coverage.xml --cov=cyclops -n auto --dist loadscope
6063
- name: Upload coverage to Codecov

.github/workflows/package.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ jobs:
2929
- uses: actions/[email protected]
3030
- name: Install pip
3131
run: python3 -m pip install --upgrade pip
32-
- uses: actions/[email protected]
32+
- name: "Set up Python"
33+
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38
3334
with:
34-
python-version: '3.10'
35+
python-version-file: ".python-version"
3536
- name: Install package and test import
3637
run: |
3738
pip install -e .

.github/workflows/publish.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
name: publish package
2+
permissions:
3+
contents: read
4+
pull-requests: write
25

36
on:
47
release:
@@ -13,13 +16,25 @@ jobs:
1316
sudo apt-get update
1417
sudo apt-get install libcurl4-openssl-dev libssl-dev
1518
- uses: actions/[email protected]
16-
- name: Install poetry
17-
run: python3 -m pip install --upgrade pip && python3 -m pip install poetry
18-
- uses: actions/[email protected]
19+
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@4db96194c378173c656ce18a155ffc14a9fc4355
22+
with:
23+
# Install a specific version of uv.
24+
version: "0.5.21"
25+
enable-cache: true
26+
27+
- name: "Set up Python"
28+
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38
1929
with:
20-
python-version: '3.10'
30+
python-version-file: ".python-version"
31+
32+
- name: Install the project
33+
run: uv sync --all-extras
34+
2135
- name: Build package
22-
run: poetry build
36+
run: uv build
37+
2338
- name: Publish package
2439
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc
2540
with:

.github/workflows/unit_tests.yml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
- '**.html'
1212
- '**.jinja'
1313
- '**.js'
14-
- poetry.lock
14+
- uv.lock
1515
- pyproject.toml
1616
pull_request:
1717
branches:
@@ -23,25 +23,28 @@ on:
2323
- '**.html'
2424
- '**.jinja'
2525
- '**.js'
26-
- poetry.lock
26+
- uv.lock
2727
- pyproject.toml
2828

2929
jobs:
3030
build:
3131
runs-on: ubuntu-latest
3232
steps:
3333
- uses: actions/[email protected]
34-
- name: Install dependencies, run unit tests and coverage report
35-
run: python3 -m pip install --upgrade pip && python3 -m pip install poetry
36-
- uses: actions/[email protected]
34+
- name: Install uv
35+
uses: astral-sh/setup-uv@4db96194c378173c656ce18a155ffc14a9fc4355
3736
with:
38-
python-version: '3.10'
39-
cache: 'poetry'
37+
# Install a specific version of uv.
38+
version: "0.5.21"
39+
enable-cache: true
40+
- name: "Set up Python"
41+
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38
42+
with:
43+
python-version-file: ".python-version"
44+
- name: Install the project
45+
run: uv sync --group test
4046
- run: |
41-
python3 -m pip install --upgrade pip && python3 -m pip install poetry
42-
poetry env use '3.10'
43-
source $(poetry env info --path)/bin/activate
44-
poetry install --with test --all-extras
47+
source .venv/bin/activate
4548
pytest -m "not integration_test" --cov-report term --cov-report xml:./coverage.xml --cov=cyclops -n auto --dist loadscope
4649
- name: Upload coverage to Codecov
4750
uses: Wandalen/[email protected]

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,29 +53,29 @@ below.
5353

5454
## 🧑🏿‍💻 Developing
5555

56-
### Using poetry
56+
### Using uv
5757

5858
The development environment can be set up using
59-
[poetry](https://python-poetry.org/docs/#installation). Hence, make sure it is
59+
[uv](https://github.com/astral-sh/uv?tab=readme-ov-file#installation). Hence, make sure it is
6060
installed and then run:
6161

6262
```bash
63-
python3 -m poetry install
64-
source $(poetry env info --path)/bin/activate
63+
uv sync
64+
source .venv/bin/activate
6565
```
6666

6767
In order to install dependencies for testing (codestyle, unit tests, integration tests),
6868
run:
6969

7070
```bash
71-
python3 -m poetry install --with test
71+
uv sync --group test
7272
```
7373

7474
API documentation is built using [Sphinx](https://www.sphinx-doc.org/en/master/) and
7575
can be locally built by:
7676

7777
```bash
78-
python3 -m poetry install --with docs
78+
uv sync --group docs
7979
cd docs
8080
make html SPHINXOPTS="-D nbsphinx_allow_errors=True"
8181
```
@@ -89,7 +89,7 @@ guidelines.
8989

9090
## 📚 [Documentation](https://vectorinstitute.github.io/cyclops/)
9191

92-
If you need to build the documentations locally, make sure to install ``Pandoc`` in addition to ``docs`` poetry group.
92+
If you need to build the documentations locally, make sure to install ``Pandoc`` in addition to ``docs`` dependency group.
9393

9494

9595
## 📓 Notebooks

0 commit comments

Comments
 (0)