Skip to content

Commit fea8376

Browse files
committed
chore: migrate from poetry to uv
Convert pyproject.toml to PEP 621 with hatchling backend and PEP 735 dependency groups, replace poetry commands in noxfile and CI workflows with uv equivalents, swap poetry.lock for uv.lock, and update install docs to recommend uv add. https://claude.ai/code/session_01YcFhUy7dEUad35PR1tQT8S
1 parent fbef81c commit fea8376

7 files changed

Lines changed: 3951 additions & 5895 deletions

File tree

.github/workflows/docs.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@ jobs:
1212
- name: Checkout repository
1313
uses: actions/checkout@v4
1414

15+
- name: Install uv
16+
uses: astral-sh/setup-uv@v3
17+
1518
- name: Set up Python
1619
uses: actions/setup-python@v5
1720
with:
1821
python-version: '3.10'
1922

20-
- name: Install Poetry
21-
uses: snok/install-poetry@v1
22-
2323
- name: Install dependencies
2424
run: |
25-
poetry install --only docs
25+
uv sync --only-group docs
2626
2727
- name: Build documentation
2828
run: |
29-
poetry run mkdocs build
29+
uv run mkdocs build
3030
3131
- name: Deploy to GitHub Pages
3232
uses: peaceiris/actions-gh-pages@v3

.github/workflows/pipeline.yaml

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@ jobs:
1313
with:
1414
lfs: true
1515
ref: ${{ github.ref_name }}
16-
- name: Install Poetry
17-
uses: snok/install-poetry@v1
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@v3
1818
- name: Set up Python
1919
uses: actions/setup-python@v5
2020
with:
2121
python-version: "3.10"
2222
- name: Install dependencies
23-
run: poetry install
23+
run: uv sync --all-groups
2424

2525
- name: Install nox dependencies
26-
run: poetry run nox -s install
26+
run: uv run nox -s install
2727

2828
- name: Run linting
29-
run: poetry run nox -s linting
29+
run: uv run nox -s linting
3030

3131
tests:
3232
needs: [linting]
@@ -37,10 +37,8 @@ jobs:
3737
with:
3838
lfs: true
3939
ref: ${{ github.ref_name }}
40-
- name: Install Poetry
41-
uses: snok/install-poetry@v1
42-
with:
43-
version: 1.3.2
40+
- name: Install uv
41+
uses: astral-sh/setup-uv@v3
4442
- name: Install graphviz
4543
run: |
4644
sudo apt update
@@ -50,12 +48,12 @@ jobs:
5048
with:
5149
python-version: "3.10"
5250
- name: Install dependencies
53-
run: poetry install
51+
run: uv sync --all-groups
5452

5553
- name: Install nox dependencies
56-
run: poetry run nox -s install
54+
run: uv run nox -s install
5755
- name: Run tests
58-
run: poetry run nox -s tests
56+
run: uv run nox -s tests
5957

6058
create-revision-and-tag:
6159
if: startsWith(github.ref, 'refs/heads/main')
@@ -68,14 +66,18 @@ jobs:
6866
token: ${{ secrets.ACCESS_TOKEN }}
6967
ref: ${{ github.ref_name }}
7068

71-
- name: Install Poetry
72-
uses: snok/install-poetry@v1
69+
- name: Install uv
70+
uses: astral-sh/setup-uv@v3
71+
- name: Set up Python
72+
uses: actions/setup-python@v5
73+
with:
74+
python-version: "3.10"
7375

7476
- name: Determine Versioning Strategy
7577
run: |
7678
echo "Bumping minor version"
77-
poetry version minor
78-
echo "NEW_VERSION=$(poetry version -s)" >> $GITHUB_ENV
79+
uv version --bump minor
80+
echo "NEW_VERSION=$(uv version --short)" >> $GITHUB_ENV
7981
- name: Commit changes
8082
uses: stefanzweifel/git-auto-commit-action@v5
8183
with:
@@ -98,16 +100,20 @@ jobs:
98100
token: ${{ secrets.ACCESS_TOKEN }}
99101
ref: ${{ github.ref_name }}
100102

101-
- name: Install Poetry
102-
uses: snok/install-poetry@v1
103+
- name: Install uv
104+
uses: astral-sh/setup-uv@v3
105+
- name: Set up Python
106+
uses: actions/setup-python@v5
107+
with:
108+
python-version: "3.10"
103109

104110
- name: Determine Current Version
105111
run: |
106112
echo "NEW_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
107113
108114
- name: Build source and wheel archives
109115
id: build
110-
run: poetry build
116+
run: uv build
111117
- name: Get Commit Messages Since Last Tag
112118
id: commit_messages
113119
run: |
@@ -139,4 +145,4 @@ jobs:
139145
uses: pypa/gh-action-pypi-publish@release/v1
140146
with:
141147
password: ${{ secrets.PYPI_API_TOKEN }}
142-
repository_url: https://upload.pypi.org/legacy/
148+
repository_url: https://upload.pypi.org/legacy/

docs_src/getting_started/installation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
content="""ifctrano is a python package that can be installed using pip."""
3838
),
3939
DisplayObject(language="bash", object="pip install ifctrano"),
40-
CleanedText(content="""ifctrano can also be used using poetry."""),
41-
DisplayObject(language="bash", object="poetry add ifctrano"),
40+
CleanedText(content="""ifctrano can also be used using uv."""),
41+
DisplayObject(language="bash", object="uv add ifctrano"),
4242
CleanedText(
4343
content="""To check the installation, run the following command in the terminal."""
4444
),

noxfile.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,35 @@
66

77
@nox.session(python=["3.10"])
88
def install(session: Session) -> None:
9-
groups = ["main", "dev", "docs"]
109
session.run(
11-
"poetry",
12-
"install",
13-
"--no-root",
14-
"--sync",
15-
f"--only={','.join(groups)}",
10+
"uv",
11+
"sync",
12+
"--all-groups",
1613
external=True,
1714
)
1815

1916

2017
@nox.session(python=["3.10"])
2118
def linting(session: Session) -> None:
22-
session.run("poetry", "run", "black", ".")
23-
session.run("poetry", "run", "mypy")
19+
session.run("uv", "run", "black", ".", external=True)
20+
session.run("uv", "run", "mypy", external=True)
2421
session.run(
25-
"poetry",
22+
"uv",
2623
"run",
2724
"ruff",
2825
"check",
2926
"--fix",
3027
"--show-fixes",
3128
"--exit-non-zero-on-fix",
29+
external=True,
3230
)
3331

3432

3533
@nox.session(python=["3.10"])
3634
def tests(session: Session) -> None:
37-
session.run("poetry", "run", "pytest", "-m", "not large")
35+
session.run("uv", "run", "pytest", "-m", "not large", external=True)
3836

3937

4038
@nox.session(python=["3.10"])
4139
def integration(session: Session) -> None:
42-
session.run("poetry", "run", "pytest", "-m", "integration")
40+
session.run("uv", "run", "pytest", "-m", "integration", external=True)

0 commit comments

Comments
 (0)