From 14bc55e9e2618c32b422636b6e8ceb706ca6c85c Mon Sep 17 00:00:00 2001 From: Danny Willems Date: Mon, 16 Mar 2026 18:22:02 +0100 Subject: [PATCH 1/2] 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 --- .github/workflows/actions.yml | 12 +++------ .github/workflows/ci-per-commit.yaml | 5 ++-- .gitignore | 4 +-- .python-version | 1 + Makefile | 22 +++++++-------- README.md | 2 +- pyproject.toml | 40 +++++++++++++++------------- 7 files changed, 42 insertions(+), 44 deletions(-) create mode 100644 .python-version diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 4972f79..0bd0b02 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -7,19 +7,17 @@ jobs: fail-fast: false matrix: python-version: ["3.13"] - poetry-version: ["2.3.1"] os: [ubuntu-latest, macos-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 GNU sed on macOS if: runner.os == 'macOS' run: brew install gnu-sed - - name: Install poetry - run: pip install poetry==${{ matrix.poetry-version}} - name: Install deps run: make install - name: Run tests @@ -36,15 +34,13 @@ jobs: fail-fast: false matrix: python-version: ["3.13"] - poetry-version: ["2.3.1"] runs-on: windows-latest 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: Install deps run: make install - name: Run tests diff --git a/.github/workflows/ci-per-commit.yaml b/.github/workflows/ci-per-commit.yaml index 353c2f5..3cb2112 100644 --- a/.github/workflows/ci-per-commit.yaml +++ b/.github/workflows/ci-per-commit.yaml @@ -37,14 +37,13 @@ jobs: - uses: actions/checkout@v6 with: fetch-depth: 0 - - uses: actions/setup-python@v6 + - name: Install uv + uses: astral-sh/setup-uv@v6 with: python-version: "3.13" - name: Install GNU sed (macOS) if: runner.os == 'macOS' run: brew install gnu-sed - - name: Install poetry - run: pip install poetry==2.3.1 - name: Determine commit range id: range env: diff --git a/.gitignore b/.gitignore index 2421645..87bdb8c 100644 --- a/.gitignore +++ b/.gitignore @@ -82,7 +82,7 @@ profile_default/ ipython_config.py # pyenv -.python-version +# .python-version is tracked for uv # pipenv # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. @@ -128,4 +128,4 @@ dmypy.json # Pyre type checker .pyre/ -poetry.lock \ No newline at end of file +uv.lock \ No newline at end of file diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..24ee5b1 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.13 diff --git a/Makefile b/Makefile index 54d40ec..43a45eb 100644 --- a/Makefile +++ b/Makefile @@ -8,35 +8,35 @@ help: ## Ask for help! .PHONY: install install: ## Install dependencies - poetry install + uv sync .PHONY: build build: ## Build the package - poetry build + uv build .PHONY: test test: ## Run tests - poetry run pytest + uv run pytest .PHONY: test-cov test-cov: ## Run tests with coverage - poetry run pytest --cov=leakix --cov-report=term-missing + uv run pytest --cov=leakix --cov-report=term-missing .PHONY: format format: ## Format code with ruff - poetry run ruff format leakix/ tests/ example/ executable/ + uv run ruff format leakix/ tests/ example/ executable/ .PHONY: check-format check-format: ## Check code formatting - poetry run ruff format --check leakix/ tests/ example/ executable/ + uv run ruff format --check leakix/ tests/ example/ executable/ .PHONY: lint lint: ## Run ruff linter - poetry run ruff check leakix/ tests/ example/ executable/ + uv run ruff check leakix/ tests/ example/ executable/ .PHONY: lint-fix lint-fix: ## Run ruff linter with auto-fix - poetry run ruff check --fix leakix/ tests/ example/ executable/ + uv run ruff check --fix leakix/ tests/ example/ executable/ .PHONY: lint-shell lint-shell: ## Lint shell scripts using shellcheck @@ -44,18 +44,18 @@ lint-shell: ## Lint shell scripts using shellcheck .PHONY: typecheck typecheck: ## Run mypy type checker - poetry run mypy leakix/ + uv run mypy leakix/ .PHONY: audit audit: ## Run security audit - poetry run pip-audit + uv run pip-audit .PHONY: check check: check-format lint typecheck test ## Run all checks .PHONY: check-outdated check-outdated: ## Check for outdated dependencies - poetry show --outdated || true + uv pip list --outdated || true .PHONY: clean clean: ## Clean build artifacts diff --git a/README.md b/README.md index b5d5be4..ddaa9f7 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Official LeakIX python client pip install leakix ``` -To run tests, use `poetry run pytest`. +To run tests, use `make test`. ## Documentation diff --git a/pyproject.toml b/pyproject.toml index 429577a..fc142e5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,23 +1,25 @@ -[tool.poetry] +[project] name = "leakix" version = "0.1.10" description = "Official python client for LeakIX (https://leakix.net)" -authors = ["Danny Willems "] - -[tool.poetry.dependencies] -python = "^3.13" -requests = "*" -l9format = "=1.4.0" -fire = ">=0.5,<0.8" - -[tool.poetry.group.dev.dependencies] -python-decouple = "*" -pytest = "*" -pytest-cov = "*" -mypy = "*" -requests-mock = "*" -ruff = "*" -pip-audit = "*" +authors = [{ name = "Danny Willems", email = "danny@leakix.net" }] +requires-python = ">=3.13" +dependencies = [ + "requests", + "l9format==1.4.0", + "fire>=0.5,<0.8", +] + +[dependency-groups] +dev = [ + "python-decouple", + "pytest", + "pytest-cov", + "mypy", + "requests-mock", + "ruff", + "pip-audit", +] [tool.ruff] line-length = 88 @@ -46,5 +48,5 @@ testpaths = ["tests"] addopts = "-v" [build-system] -requires = ["poetry-core>=1.0.0"] -build-backend = "poetry.core.masonry.api" +requires = ["hatchling"] +build-backend = "hatchling.build" From 3a362038a43ae8e16aa746c7fb398d9fb6db4961 Mon Sep 17 00:00:00 2001 From: Danny Willems Date: Mon, 16 Mar 2026 18:23:05 +0100 Subject: [PATCH 2/2] CHANGELOG: migrate from Poetry to uv --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d936d74..fc78ffd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to - CI: use Makefile targets in Windows job and add sequential per-commit testing triggered by the ci:per-commit label ([3967e42], [#66]) - Remove duplicated lint-shell target in Makefile ([a652654], [#67]) +- Migrate from Poetry to uv ([14bc55e], [#65]) ## [0.1.10] - 2024-12-XX @@ -53,6 +54,7 @@ and this project adheres to [0.1.9]: https://github.com/LeakIX/LeakIXClient-Python/releases/tag/v0.1.9 +[14bc55e]: https://github.com/LeakIX/LeakIXClient-Python/commit/14bc55e [a652654]: https://github.com/LeakIX/LeakIXClient-Python/commit/a652654 [3967e42]: https://github.com/LeakIX/LeakIXClient-Python/commit/3967e42 [ae676d9]: https://github.com/LeakIX/LeakIXClient-Python/commit/ae676d9 @@ -66,4 +68,5 @@ and this project adheres to [#66]: https://github.com/LeakIX/LeakIXClient-Python/pull/66 +[#65]: https://github.com/LeakIX/LeakIXClient-Python/issues/65 [#67]: https://github.com/LeakIX/LeakIXClient-Python/issues/67