Skip to content

Commit 5f4fc51

Browse files
Copilotdannywillems
andcommitted
chore: migrate from Poetry to uv
Co-authored-by: dannywillems <6018454+dannywillems@users.noreply.github.com>
1 parent 6996e7f commit 5f4fc51

5 files changed

Lines changed: 54 additions & 56 deletions

File tree

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
version: 2
55
updates:
6-
# Monitor pip dependencies (Poetry uses pip under the hood)
6+
# Monitor pip dependencies (uv uses pip under the hood)
77
- package-ecosystem: "pip"
88
directory: "/"
99
schedule:

.github/workflows/action.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,26 @@ jobs:
77
fail-fast: false
88
matrix:
99
python-version: ["3.11", "3.12", "3.13"]
10-
poetry-version: ["2.3.1"]
1110
os: ["ubuntu-latest", "macos-latest", "windows-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 }}
18-
- name: Install poetry
19-
run: pip install poetry==${{ matrix.poetry-version }}
20-
- name: View poetry --help
21-
run: poetry --help
22-
- name: Run poetry install
23-
run: poetry install
18+
- name: Install dependencies
19+
run: uv sync
2420
- name: lint
25-
run: poetry run ruff check .
21+
run: uv run ruff check .
2622
- name: format check
27-
run: poetry run black --check .
23+
run: uv run black --check .
2824
- name: sort-check
29-
run: poetry run isort --check-only .
25+
run: uv run isort --check-only .
3026
- name: typecheck
31-
run: poetry run mypy l9format
27+
run: uv run mypy l9format
3228
- name: test
33-
run: poetry run pytest
29+
run: uv run pytest
3430
- name: security-audit
35-
run: poetry run pip-audit
31+
run: uv run pip-audit
3632

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,4 +129,4 @@ dmypy.json
129129
.pyre/
130130

131131
.idea
132-
poetry.lock
132+
uv.lock

Makefile

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Makefile for l9format-python project
22

3-
VERSION := $(shell poetry version -s)
3+
VERSION := $(shell python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
44

55
UNAME_S := $(shell uname -s)
66
ifeq ($(UNAME_S),Darwin)
@@ -24,43 +24,43 @@ all: format sort lint typecheck test security-check ## Run all quality checks
2424

2525
.PHONY: test
2626
test: ## Run tests using pytest
27-
poetry run pytest
27+
uv run pytest
2828

2929
.PHONY: format
3030
format: ## Format code using black
31-
poetry run black .
31+
uv run black .
3232

3333
.PHONY: check-format
3434
check-format: ## Check code formatting with black
35-
poetry run black --check .
35+
uv run black --check .
3636

3737
.PHONY: sort
3838
sort: ## Sort imports using isort
39-
poetry run isort .
39+
uv run isort .
4040

4141
.PHONY: check-sort
4242
check-sort: ## Check import sorting with isort
43-
poetry run isort --check-only .
43+
uv run isort --check-only .
4444

4545
.PHONY: lint
4646
lint: ## Lint code using ruff
47-
poetry run ruff check .
47+
uv run ruff check .
4848

4949
.PHONY: lint-fix
5050
lint-fix: ## Lint and fix code using ruff
51-
poetry run ruff check --fix .
51+
uv run ruff check --fix .
5252

5353
.PHONY: lint-shell
5454
lint-shell: ## Lint shell scripts using shellcheck
5555
shellcheck .github/scripts/*.sh
5656

5757
.PHONY: typecheck
5858
typecheck: ## Run mypy type checker
59-
poetry run mypy l9format
59+
uv run mypy l9format
6060

6161
.PHONY: security-check
6262
security-check: ## Check for vulnerable dependencies using pip-audit
63-
poetry run pip-audit
63+
uv run pip-audit
6464

6565
.PHONY: fix-trailing-whitespace
6666
fix-trailing-whitespace: ## Remove trailing whitespaces from all files
@@ -97,12 +97,12 @@ check-trailing-whitespace: ## Check for trailing whitespaces in source files
9797
fi
9898

9999
.PHONY: install
100-
install: ## Install dependencies with Poetry
101-
poetry install
100+
install: ## Install dependencies with uv
101+
uv sync
102102

103103
.PHONY: build
104104
build: clean-dist ## Build package for distribution
105-
poetry build
105+
uv build
106106

107107
.PHONY: publish-dry-run
108108
publish-dry-run: build ## Dry-run: show what would be published
@@ -111,11 +111,11 @@ publish-dry-run: build ## Dry-run: show what would be published
111111
@echo "Would create GitHub release: v$(VERSION)"
112112
@echo "Package contents:"
113113
@ls -lh dist/
114-
poetry publish --dry-run
114+
uv publish --dry-run
115115

116116
.PHONY: publish
117117
publish: build ## Publish to PyPI, tag and create GitHub release
118-
poetry publish
118+
uv publish
119119
git tag -a "v$(VERSION)" -m "Release v$(VERSION)"
120120
git push origin "v$(VERSION)"
121121
gh release create "v$(VERSION)" dist/* \

pyproject.toml

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,36 @@
1-
[tool.poetry]
1+
[project]
22
name = "l9format"
33
version = "1.4.0"
4-
license = "MIT"
4+
license = {text = "MIT"}
55
description = "l9format is a schema declaration targeted at interoperability between network recon tools used at LeakIX"
6-
authors = ["Danny Willems <danny@leakix.net>"]
7-
maintainers = ["Danny Willems <danny@leakix.net>"]
6+
authors = [{name = "Danny Willems", email = "danny@leakix.net"}]
7+
maintainers = [{name = "Danny Willems", email = "danny@leakix.net"}]
88
readme = "README.md"
9-
homepage = "https://github.com/leakix/l9format-python"
10-
repository = "https://github.com/leakix/l9format-python"
11-
documentation = "https://github.com/leakix/l9format-python"
12-
13-
[tool.poetry.dependencies]
14-
python = "^3.11"
15-
serde = "^0.9.0"
16-
17-
[tool.poetry.group.dev.dependencies]
18-
black = "^26.1.0"
19-
fire = "^0.7.1"
20-
isort = "^7.0.0"
21-
mypy = "^1.19.0"
22-
pip-audit = "^2.10.0"
23-
pytest = "^9.0.2"
24-
ruff = "^0.14.14"
9+
requires-python = ">=3.11"
10+
dependencies = [
11+
"serde>=0.9.0",
12+
]
13+
14+
[project.urls]
15+
Homepage = "https://github.com/leakix/l9format-python"
16+
Repository = "https://github.com/leakix/l9format-python"
17+
Documentation = "https://github.com/leakix/l9format-python"
18+
"Bug Tracker" = "https://github.com/leakix/l9format-python/issues"
2519

26-
[build-system]
27-
requires = ["poetry-core>=1.0.0"]
28-
build-backend = "poetry.core.masonry.api"
20+
[dependency-groups]
21+
dev = [
22+
"black>=26.1.0",
23+
"fire>=0.7.1",
24+
"isort>=7.0.0",
25+
"mypy>=1.19.0",
26+
"pip-audit>=2.10.0",
27+
"pytest>=9.0.2",
28+
"ruff>=0.14.14",
29+
]
2930

30-
[tool.poetry.urls]
31-
"Bug Tracker" = "https://github.com/leakix/l9format-python/issues"
31+
[build-system]
32+
requires = ["hatchling"]
33+
build-backend = "hatchling.build"
3234

3335
[tool.ruff]
3436
line-length = 80

0 commit comments

Comments
 (0)