Skip to content

Commit db7bfe3

Browse files
committed
migrate poetry -> uv
1 parent bccd088 commit db7bfe3

8 files changed

Lines changed: 1197 additions & 2417 deletions

File tree

.github/workflows/main.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,18 @@ jobs:
3434
# You can test your matrix by printing the current Python version
3535
- name: Display Python version
3636
run: python -c "import sys; print(sys.version)"
37-
# Install Poetry and dependencies
38-
- name: Install Poetry
39-
uses: snok/install-poetry@v1
37+
- name: Install uv
38+
uses: astral-sh/setup-uv@v6
4039
- name: Set up cache
4140
uses: actions/cache@v3
4241
with:
4342
path: ${{ matrix.path }}
44-
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('poetry.lock') }}
43+
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('uv.lock') }}
4544
restore-keys: |
4645
${{ runner.os }}-pip-
4746
- name: Install dependencies
4847
run: |
49-
poetry config virtualenvs.in-project true
50-
poetry install
48+
uv sync --group dev
5149
# Runs a single command using the runners shell
5250
- name: Run style checks
5351
run: |

.readthedocs.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ build:
77
tools: {python: "3.10"}
88
jobs:
99
post_create_environment:
10-
- pip install poetry
11-
- poetry config virtualenvs.create false
10+
- pip install uv
1211
post_install:
13-
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH make install # poetry install --all-extras
12+
- UV_PROJECT_ENVIRONMENT=$READTHEDOCS_VIRTUALENV_PATH uv sync --group docs
1413

1514
# Build documentation in the docs/ directory with Sphinx
1615
sphinx:

Makefile

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,58 +2,54 @@
22
PYTHON := python3
33
PYTHONPATH := `pwd`
44

5-
#* Poetry
6-
.PHONY: poetry-download
7-
poetry-download:
8-
curl -sSL https://install.python-poetry.org/ | $(PYTHON) -
9-
10-
.PHONY: poetry-remove
11-
poetry-remove:
12-
curl -sSL https://install.python-poetry.org/ | $(PYTHON) - --uninstall
5+
#* uv
6+
.PHONY: uv-download
7+
uv-download:
8+
curl -LsSf https://astral.sh/uv/install.sh | sh
139

1410
#* Installation
1511
.PHONY: install
1612
install:
17-
poetry install -n --with dev,docs,examples
13+
uv sync --all-groups
1814

1915
.PHONY: pre-commit-install
2016
pre-commit-install:
21-
poetry run pre-commit install
17+
uv run pre-commit install
2218

2319
#* Formatters
2420
.PHONY: codestyle
2521
codestyle:
26-
poetry run pyupgrade --exit-zero-even-if-changed --py38-plus **/*.py
27-
poetry run isort --settings-path pyproject.toml ./
28-
poetry run black --config pyproject.toml ./
22+
uv run pyupgrade --exit-zero-even-if-changed --py38-plus **/*.py
23+
uv run isort --settings-path pyproject.toml ./
24+
uv run black --config pyproject.toml ./
2925

3026
.PHONY: formatting
3127
formatting: codestyle
3228

3329
#* Linting
3430
.PHONY: test
3531
test:
36-
poetry run pytest -c pyproject.toml --cov=src
32+
uv run pytest -c pyproject.toml --cov=src
3733

3834
.PHONY: test_ci
3935
test_ci:
40-
poetry run pytest -c pyproject.toml --cov=src --cov-report=xml
36+
uv run pytest -c pyproject.toml --cov=src --cov-report=xml
4137

4238
.PHONY: check-codestyle
4339
check-codestyle:
44-
poetry run isort --diff --check-only --settings-path pyproject.toml ./
45-
poetry run black --diff --check --config pyproject.toml ./
40+
uv run isort --diff --check-only --settings-path pyproject.toml ./
41+
uv run black --diff --check --config pyproject.toml ./
4642

4743
.PHONY: mypy
4844
mypy:
49-
poetry run mypy --config-file pyproject.toml src
45+
uv run mypy --config-file pyproject.toml src
5046

5147
.PHONY: lint
5248
lint: test check-codestyle mypy check-safety
5349

5450
.PHONY: update-dev-deps
5551
update-dev-deps:
56-
poetry add -D "isort[colors]@latest" mypy@latest pre-commit@latest pydocstyle@latest pylint@latest pytest@latest pyupgrade@latest coverage@latest pytest-html@latest pytest-cov@latest black@latest
52+
uv add --group dev --upgrade "isort[colors]" mypy pre-commit pytest pyupgrade coverage pytest-html pytest-cov black
5753

5854
#* Cleaning
5955
.PHONY: pycache-remove

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ We provide minimal [example scripts](.examples) to demonstrate the usage of the
3232
## Development version
3333

3434
The development version includes unit-tests, documentation, examples, and other development tools.
35-
We primarily use [`poetry`](https://python-poetry.org/) to manage the dependencies and the development environment.
35+
We primarily use [`uv`](https://docs.astral.sh/uv/) to manage the dependencies and the development environment.
3636
Necessary commands are provided in the `Makefile`.
3737

3838
```sh
3939
git clone https://github.com/GazzolaLab/Blender-Soft-Rod.git
4040
cd Blender-Soft-Rod
41-
make install # Assuming you have poetry installed.
41+
make install # Assuming you have uv installed.
4242
make pre-commit-install
4343
```
4444

examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This directory contains number of examples of how to use this library.
77
All necessary requirement can be installed as follows:
88

99
```bash
10-
poetry instal -n --with examples
10+
uv sync --group examples
1111
```
1212

1313
## Case Examples

0 commit comments

Comments
 (0)