Skip to content

Commit 1adfd0d

Browse files
committed
Migrate from Poetry to uv
Replace Poetry with uv as the Python package manager. Convert pyproject.toml to PEP 621 format with hatchling build backend. Update Makefile targets, CI workflows, and README. Closes #65
1 parent 21d2f3b commit 1adfd0d

7 files changed

Lines changed: 42 additions & 44 deletions

File tree

.github/workflows/actions.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,17 @@ jobs:
77
fail-fast: false
88
matrix:
99
python-version: ["3.13"]
10-
poetry-version: ["2.3.1"]
1110
os: [ubuntu-latest, macos-latest]
1211
runs-on: ${{ matrix.os }}
1312
steps:
1413
- uses: actions/checkout@v6
15-
- uses: actions/setup-python@v6
14+
- name: Install uv
15+
uses: astral-sh/setup-uv@v6
1616
with:
1717
python-version: ${{ matrix.python-version }}
1818
- name: Install GNU sed on macOS
1919
if: runner.os == 'macOS'
2020
run: brew install gnu-sed
21-
- name: Install poetry
22-
run: pip install poetry==${{ matrix.poetry-version}}
2321
- name: Install deps
2422
run: make install
2523
- name: Run tests
@@ -36,15 +34,13 @@ jobs:
3634
fail-fast: false
3735
matrix:
3836
python-version: ["3.13"]
39-
poetry-version: ["2.3.1"]
4037
runs-on: windows-latest
4138
steps:
4239
- uses: actions/checkout@v6
43-
- uses: actions/setup-python@v6
40+
- name: Install uv
41+
uses: astral-sh/setup-uv@v6
4442
with:
4543
python-version: ${{ matrix.python-version }}
46-
- name: Install poetry
47-
run: pip install poetry==${{ matrix.poetry-version}}
4844
- name: Install deps
4945
run: make install
5046
- name: Run tests

.github/workflows/ci-per-commit.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,13 @@ jobs:
3737
- uses: actions/checkout@v6
3838
with:
3939
fetch-depth: 0
40-
- uses: actions/setup-python@v6
40+
- name: Install uv
41+
uses: astral-sh/setup-uv@v6
4142
with:
4243
python-version: "3.13"
4344
- name: Install GNU sed (macOS)
4445
if: runner.os == 'macOS'
4546
run: brew install gnu-sed
46-
- name: Install poetry
47-
run: pip install poetry==2.3.1
4847
- name: Determine commit range
4948
id: range
5049
env:

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ profile_default/
8282
ipython_config.py
8383

8484
# pyenv
85-
.python-version
85+
# .python-version is tracked for uv
8686

8787
# pipenv
8888
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
@@ -128,4 +128,4 @@ dmypy.json
128128
# Pyre type checker
129129
.pyre/
130130

131-
poetry.lock
131+
uv.lock

.python-version

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

Makefile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,54 +8,54 @@ help: ## Ask for help!
88

99
.PHONY: install
1010
install: ## Install dependencies
11-
poetry install
11+
uv sync
1212

1313
.PHONY: build
1414
build: ## Build the package
15-
poetry build
15+
uv build
1616

1717
.PHONY: test
1818
test: ## Run tests
19-
poetry run pytest
19+
uv run pytest
2020

2121
.PHONY: test-cov
2222
test-cov: ## Run tests with coverage
23-
poetry run pytest --cov=leakix --cov-report=term-missing
23+
uv run pytest --cov=leakix --cov-report=term-missing
2424

2525
.PHONY: format
2626
format: ## Format code with ruff
27-
poetry run ruff format leakix/ tests/ example/ executable/
27+
uv run ruff format leakix/ tests/ example/ executable/
2828

2929
.PHONY: check-format
3030
check-format: ## Check code formatting
31-
poetry run ruff format --check leakix/ tests/ example/ executable/
31+
uv run ruff format --check leakix/ tests/ example/ executable/
3232

3333
.PHONY: lint
3434
lint: ## Run ruff linter
35-
poetry run ruff check leakix/ tests/ example/ executable/
35+
uv run ruff check leakix/ tests/ example/ executable/
3636

3737
.PHONY: lint-fix
3838
lint-fix: ## Run ruff linter with auto-fix
39-
poetry run ruff check --fix leakix/ tests/ example/ executable/
39+
uv run ruff check --fix leakix/ tests/ example/ executable/
4040

4141
.PHONY: lint-shell
4242
lint-shell: ## Lint shell scripts using shellcheck
4343
shellcheck .github/scripts/*.sh
4444

4545
.PHONY: typecheck
4646
typecheck: ## Run mypy type checker
47-
poetry run mypy leakix/
47+
uv run mypy leakix/
4848

4949
.PHONY: audit
5050
audit: ## Run security audit
51-
poetry run pip-audit
51+
uv run pip-audit
5252

5353
.PHONY: check
5454
check: check-format lint typecheck test ## Run all checks
5555

5656
.PHONY: check-outdated
5757
check-outdated: ## Check for outdated dependencies
58-
poetry show --outdated || true
58+
uv pip list --outdated || true
5959

6060
.PHONY: clean
6161
clean: ## Clean build artifacts

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Official LeakIX python client
1111
pip install leakix
1212
```
1313

14-
To run tests, use `poetry run pytest`.
14+
To run tests, use `make test`.
1515

1616
## Documentation
1717

pyproject.toml

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
1-
[tool.poetry]
1+
[project]
22
name = "leakix"
33
version = "0.1.10"
44
description = "Official python client for LeakIX (https://leakix.net)"
5-
authors = ["Danny Willems <danny@leakix.net>"]
6-
7-
[tool.poetry.dependencies]
8-
python = "^3.13"
9-
requests = "*"
10-
l9format = "=1.4.0"
11-
fire = ">=0.5,<0.8"
12-
13-
[tool.poetry.group.dev.dependencies]
14-
python-decouple = "*"
15-
pytest = "*"
16-
pytest-cov = "*"
17-
mypy = "*"
18-
requests-mock = "*"
19-
ruff = "*"
20-
pip-audit = "*"
5+
authors = [{ name = "Danny Willems", email = "danny@leakix.net" }]
6+
requires-python = ">=3.13"
7+
dependencies = [
8+
"requests",
9+
"l9format==1.4.0",
10+
"fire>=0.5,<0.8",
11+
]
12+
13+
[dependency-groups]
14+
dev = [
15+
"python-decouple",
16+
"pytest",
17+
"pytest-cov",
18+
"mypy",
19+
"requests-mock",
20+
"ruff",
21+
"pip-audit",
22+
]
2123

2224
[tool.ruff]
2325
line-length = 88
@@ -46,5 +48,5 @@ testpaths = ["tests"]
4648
addopts = "-v"
4749

4850
[build-system]
49-
requires = ["poetry-core>=1.0.0"]
50-
build-backend = "poetry.core.masonry.api"
51+
requires = ["hatchling"]
52+
build-backend = "hatchling.build"

0 commit comments

Comments
 (0)