Skip to content

Commit f1c236d

Browse files
committed
dev: switch from poetry to uv
1 parent fad400c commit f1c236d

File tree

5 files changed

+1398
-1457
lines changed

5 files changed

+1398
-1457
lines changed

.github/workflows/pythonapp.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ jobs:
2525
- name: List nox envs
2626
run: nox -l
2727
- run: nox --pythons '${{ matrix.python }}'
28-
- run: uvx poetry build
29-
- run: uvx poetry check --strict
28+
- run: uv build
29+
- name: Check that the lockfile is consistent with pyproject.toml
30+
run: uv lock --check
3031
- name: Publish Unit Test Results
3132
uses: EnricoMi/publish-unit-test-result-action@v2
3233
if: always()

noxfile.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from contextlib import contextmanager
22
from typing import Generator
33

4-
import github_action_utils as gha
54
import nox
65

76
nox.options.default_venv_backend = "uv"
@@ -10,6 +9,13 @@
109

1110
@contextmanager
1211
def group(title: str) -> Generator[None, None, None]:
12+
try:
13+
import github_action_utils as gha
14+
except ImportError:
15+
# If github_action_utils is not available, just yield without starting a group
16+
# This allows the code to run outside of GitHub Actions
17+
yield
18+
return
1319
try:
1420
gha.start_group(title)
1521
yield
@@ -38,7 +44,7 @@ def nightly(session: nox.Session) -> None:
3844

3945
def tests_core(session: nox.Session, duckdb: str, sqlalchemy: str) -> None:
4046
with group(f"{session.name} - Install"):
41-
poetry(session)
47+
uv_sync(session)
4248
operator = "==" if sqlalchemy.count(".") == 2 else "~="
4349
session.install(f"sqlalchemy{operator}{sqlalchemy}")
4450
if duckdb == "master":
@@ -47,6 +53,8 @@ def tests_core(session: nox.Session, duckdb: str, sqlalchemy: str) -> None:
4753
session.install(f"duckdb=={duckdb}")
4854
with group(f"{session.name} Test"):
4955
session.run(
56+
"uv",
57+
"run",
5058
"pytest",
5159
"--junitxml=results.xml",
5260
"--cov",
@@ -61,12 +69,12 @@ def tests_core(session: nox.Session, duckdb: str, sqlalchemy: str) -> None:
6169
)
6270

6371

64-
def poetry(session: nox.Session) -> None:
65-
session.install("poetry")
66-
session.run("poetry", "install", "--with", "dev", "--verbose", silent=False)
72+
def uv_sync(session: nox.Session) -> None:
73+
session.run("uv", "sync", "--verbose", silent=False)
6774

6875

6976
@nox.session(py=["3.9"])
7077
def mypy(session: nox.Session) -> None:
71-
poetry(session)
72-
session.run("mypy", "duckdb_engine/")
78+
session.skip("We need to fix the mypy issues before running it")
79+
uv_sync(session)
80+
session.run("uv", "run", "mypy", "duckdb_engine/")

0 commit comments

Comments
 (0)