Skip to content

Commit d5cc794

Browse files
authored
Merge pull request #14 from TUM-Aries-Lab/13-update-to-uv
Use uv instead of poetry
2 parents 5c94813 + e7bcb4f commit d5cc794

File tree

9 files changed

+701
-1096
lines changed

9 files changed

+701
-1096
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,12 @@ jobs:
2424
- name: Checkout
2525
uses: actions/checkout@v4
2626

27-
- name: Set up Python
28-
uses: actions/setup-python@v5
27+
- name: Install UV
28+
uses: astral-sh/setup-uv@v1
2929
with:
30-
python-version: "3.12"
30+
version: latest
3131

32-
- name: Install Poetry
33-
uses: snok/install-poetry@v1
34-
with:
35-
virtualenvs-create: true
36-
virtualenvs-in-project: true
37-
installer-parallel: true
38-
39-
- name: Install dependencies
32+
- name: Sync dependencies
4033
run: make init
4134

4235
- name: Run Ruff
@@ -54,19 +47,12 @@ jobs:
5447
- name: Checkout
5548
uses: actions/checkout@v4
5649

57-
- name: Set up Python
58-
uses: actions/setup-python@v5
50+
- name: Install UV
51+
uses: astral-sh/setup-uv@v1
5952
with:
60-
python-version: "3.12"
53+
version: latest
6154

62-
- name: Install Poetry
63-
uses: snok/install-poetry@v1
64-
with:
65-
virtualenvs-create: true
66-
virtualenvs-in-project: true
67-
installer-parallel: true
68-
69-
- name: Install dependencies
55+
- name: Sync dependencies
7056
run: make init
7157

7258
- name: Run Mypy
@@ -89,21 +75,15 @@ jobs:
8975
- name: Checkout
9076
uses: actions/checkout@v4
9177

92-
- name: Set up Python
93-
id: py
94-
uses: actions/setup-python@v5
78+
- name: Install UV
79+
uses: astral-sh/setup-uv@v1
9580
with:
96-
python-version: ${{ matrix.python-version }}
81+
version: latest
9782

98-
- name: Install Poetry
99-
uses: snok/install-poetry@v1
100-
with:
101-
virtualenvs-create: true
102-
virtualenvs-in-project: true
103-
installer-parallel: true
83+
- name: Set Python version
84+
run: uv python install ${{ matrix.python-version }}
10485

105-
- name: Install dependencies (with dev)
106-
if: steps.cache.outputs.cache-hit != 'true'
86+
- name: Sync dependencies
10787
run: make init
10888

10989
- name: Run Pytest

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ htmlcov/
4343
../.coverage
4444
.coveragerc
4545
.coverage
46+
coverage.xml
4647
.cache
4748
nosetests.xml
4849
*.cover

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

Makefile

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
SHELL := /bin/bash
22

3-
init:
4-
python3 -m venv .venv
5-
poetry install --with dev
6-
poetry run pre-commit install
7-
poetry env info
8-
@echo "Created virtual environment"
3+
init: # ENV SETUP
4+
uv sync --all-groups
5+
uv run pre-commit install
6+
@echo "Environment initialized with uv."
97

108
test:
11-
poetry run pytest --cov=src/ --cov-report=term-missing --no-cov-on-fail --cov-report=xml --cov-fail-under=10
9+
uv run pytest --cov=src --cov-report=term-missing --no-cov-on-fail --cov-report=xml --cov-fail-under=10
1210
rm .coverage
1311

1412
lint:
15-
poetry run ruff format
16-
poetry run ruff check --fix
13+
uv run ruff format
14+
uv run ruff check --fix
1715

1816
typecheck:
19-
poetry run mypy src/ tests/ --ignore-missing-imports
17+
uv run mypy src/ tests/ --ignore-missing-imports
2018

2119
format:
2220
make lint
@@ -28,18 +26,21 @@ clean:
2826
rm -rf .pytest_cache
2927
rm -rf build/
3028
rm -rf dist/
31-
rm -rf juninit-pytest.xml
29+
rm -rf junit-pytest.xml
3230
rm -rf logs/*
3331
find . -name ".coverage*" -delete
34-
find . -name __pycache__ -exec rm -r {} +
32+
find . -name "__pycache__" -exec rm -r {} +
3533

3634
update:
37-
poetry cache clear pypi --all
38-
poetry update
35+
uv update --all-groups
36+
37+
deep-update:
38+
uv cache clear pypi --all
39+
uv update --all-groups
3940

4041
docker:
4142
docker build --no-cache -f Dockerfile -t change_me-smoke .
4243
docker run --rm change_me-smoke
4344

4445
app:
45-
poetry run python -m change_me
46+
uv run python -m change_me

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ Do ***NOT*** clone this repository. Please use it as a template instead. This re
1010
To install the library run:
1111

1212
```bash
13-
pip install <your-package-name>
13+
uv install <your-package-name>
1414
```
1515

1616
OR
1717

1818
```bash
19-
pip install git+https://github.com/TUM-Aries-Lab/<your-package-name>.git@<specific-tag>
19+
uv install git+https://github.com/TUM-Aries-Lab/<your-package-name>.git@<specific-tag>
2020
```
2121

2222
## Development
23-
0. Install [Poetry](https://python-poetry.org/docs/#installing-with-the-official-installer)
23+
0. Install [uv](https://docs.astral.sh/uv/getting-started/installation/)
2424
1. Install [pyenv](https://github.com/pyenv/pyenv?tab=readme-ov-file#installation)
2525
2. ```pyenv install <desired-python-version> # install the required python version```
2626
3. ```pyenv global <desired-python-version> # set the required python version```
@@ -34,8 +34,8 @@ pip install git+https://github.com/TUM-Aries-Lab/<your-package-name>.git@<specif
3434
It's super easy to publish your own packages on PyPI. To build and publish this package run:
3535

3636
```bash
37-
poetry build
38-
poetry publish # make sure your version in pyproject.toml is updated
37+
uv build
38+
uv publish # make sure your version in pyproject.toml is updated
3939
```
4040
The package can then be found at: https://pypi.org/project/change-me
4141

@@ -45,7 +45,7 @@ The package can then be found at: https://pypi.org/project/change-me
4545

4646
from loguru import logger
4747

48-
from change_me import definitions
48+
from change_me.config import definitions
4949

5050
def main() -> None:
5151
"""Run a simple demonstration."""
@@ -57,5 +57,5 @@ if __name__ == "__main__":
5757

5858
## Program Usage
5959
```bash
60-
poetry run python -m change_me
60+
uv run python -m change_me
6161
```

coverage.xml

Lines changed: 0 additions & 93 deletions
This file was deleted.

0 commit comments

Comments
 (0)