Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

version: 2
updates:
# Monitor pip dependencies (Poetry uses pip under the hood)
# Monitor pip dependencies (uv uses pip under the hood)
- package-ecosystem: "pip"
directory: "/"
schedule:
Expand Down
24 changes: 10 additions & 14 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,26 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
poetry-version: ["2.3.1"]
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
run: pip install poetry==${{ matrix.poetry-version }}
- name: View poetry --help
run: poetry --help
- name: Run poetry install
run: poetry install
- name: Install dependencies
run: uv sync
- name: lint
run: poetry run ruff check .
run: uv run ruff check .
- name: format check
run: poetry run black --check .
run: uv run black --check .
- name: sort-check
run: poetry run isort --check-only .
run: uv run isort --check-only .
- name: typecheck
run: poetry run mypy l9format
run: uv run mypy l9format
- name: test
run: poetry run pytest
run: uv run pytest
- name: security-audit
run: poetry run pip-audit
run: uv run pip-audit

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,4 @@ dmypy.json
.pyre/

.idea
poetry.lock
uv.lock
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ and this project adheres to
- Bump ruff dev dependency from `^0.14.14` to `>=0.14.14,<0.16.0` ([ac8a1db], [#50])
- Bump isort dev dependency from `^7.0.0` to `>=7,<9` to allow isort 8.x
([4464bfd], [#51])
- Migrate from Poetry to uv: update `pyproject.toml` to PEP 621 format with
`hatchling` build backend, replace `poetry run` with `uv run` in Makefile,
and switch CI to `astral-sh/setup-uv` ([5f4fc51], [#56])

## [1.4.0] - 2026-02-09

Expand Down Expand Up @@ -161,6 +164,7 @@ and this project adheres to
<!-- Commit links -->

[6c9eecd]: https://github.com/LeakIX/l9format-python/commit/6c9eecd
[5f4fc51]: https://github.com/LeakIX/l9format-python/commit/5f4fc51
[ac8a1db]: https://github.com/LeakIX/l9format-python/commit/ac8a1db
[4464bfd]: https://github.com/LeakIX/l9format-python/commit/4464bfd
[ac4744e]: https://github.com/LeakIX/l9format-python/commit/ac4744e
Expand Down Expand Up @@ -248,5 +252,6 @@ and this project adheres to
[#32]: https://github.com/LeakIX/l9format-python/issues/32
[#49]: https://github.com/LeakIX/l9format-python/pull/49
[#50]: https://github.com/LeakIX/l9format-python/pull/50
[#43]: https://github.com/LeakIX/l9format-python/issues/43
[#51]: https://github.com/LeakIX/l9format-python/pull/51
[#56]: https://github.com/LeakIX/l9format-python/pull/56
[#43]: https://github.com/LeakIX/l9format-python/issues/43
30 changes: 15 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Makefile for l9format-python project

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

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

.PHONY: test
test: ## Run tests using pytest
poetry run pytest
uv run pytest

.PHONY: format
format: ## Format code using black
poetry run black .
uv run black .

.PHONY: check-format
check-format: ## Check code formatting with black
poetry run black --check .
uv run black --check .

.PHONY: sort
sort: ## Sort imports using isort
poetry run isort .
uv run isort .

.PHONY: check-sort
check-sort: ## Check import sorting with isort
poetry run isort --check-only .
uv run isort --check-only .

.PHONY: lint
lint: ## Lint code using ruff
poetry run ruff check .
uv run ruff check .

.PHONY: lint-fix
lint-fix: ## Lint and fix code using ruff
poetry run ruff check --fix .
uv run ruff check --fix .

.PHONY: lint-shell
lint-shell: ## Lint shell scripts using shellcheck
shellcheck .github/scripts/*.sh

.PHONY: typecheck
typecheck: ## Run mypy type checker
poetry run mypy l9format
uv run mypy l9format

.PHONY: security-check
security-check: ## Check for vulnerable dependencies using pip-audit
poetry run pip-audit
uv run pip-audit

.PHONY: fix-trailing-whitespace
fix-trailing-whitespace: ## Remove trailing whitespaces from all files
Expand Down Expand Up @@ -97,12 +97,12 @@ check-trailing-whitespace: ## Check for trailing whitespaces in source files
fi

.PHONY: install
install: ## Install dependencies with Poetry
poetry install
install: ## Install dependencies with uv
uv sync

.PHONY: build
build: clean-dist ## Build package for distribution
poetry build
uv build

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

.PHONY: publish
publish: build ## Publish to PyPI, tag and create GitHub release
poetry publish
uv publish
git tag -a "v$(VERSION)" -m "Release v$(VERSION)"
git push origin "v$(VERSION)"
gh release create "v$(VERSION)" dist/* \
Expand Down
52 changes: 27 additions & 25 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
[tool.poetry]
[project]
name = "l9format"
version = "1.4.0"
license = "MIT"
license = {text = "MIT"}
description = "l9format is a schema declaration targeted at interoperability between network recon tools used at LeakIX"
authors = ["Danny Willems <danny@leakix.net>"]
maintainers = ["Danny Willems <danny@leakix.net>"]
authors = [{name = "Danny Willems", email = "danny@leakix.net"}]
maintainers = [{name = "Danny Willems", email = "danny@leakix.net"}]
readme = "README.md"
homepage = "https://github.com/leakix/l9format-python"
repository = "https://github.com/leakix/l9format-python"
documentation = "https://github.com/leakix/l9format-python"

[tool.poetry.dependencies]
python = "^3.11"
serde = "^0.9.0"

[tool.poetry.group.dev.dependencies]
black = "^26.1.0"
fire = "^0.7.1"
isort = ">=7,<9"
mypy = "^1.19.0"
pip-audit = "^2.10.0"
pytest = "^9.0.2"
ruff = ">=0.14.14,<0.16.0"
requires-python = ">=3.11"
dependencies = [
"serde>=0.9.0",
]

[project.urls]
Homepage = "https://github.com/leakix/l9format-python"
Repository = "https://github.com/leakix/l9format-python"
Documentation = "https://github.com/leakix/l9format-python"
"Bug Tracker" = "https://github.com/leakix/l9format-python/issues"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[dependency-groups]
dev = [
"black>=26.1.0",
"fire>=0.7.1",
"isort>=7,<9",
"mypy>=1.19.0",
"pip-audit>=2.10.0",
"pytest>=9.0.2",
"ruff>=0.14.14,<0.16.0",
]

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

[tool.ruff]
line-length = 80
Expand Down
Loading