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
12 changes: 4 additions & 8 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/ci-per-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -128,4 +128,4 @@ dmypy.json
# Pyre type checker
.pyre/

poetry.lock
uv.lock
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.13
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -53,6 +54,7 @@ and this project adheres to
[0.1.9]: https://github.com/LeakIX/LeakIXClient-Python/releases/tag/v0.1.9

<!-- Commit links -->
[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
Expand All @@ -66,4 +68,5 @@ and this project adheres to

<!-- PR links -->
[#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
22 changes: 11 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,54 +8,54 @@ 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
shellcheck .github/scripts/*.sh

.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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
40 changes: 21 additions & 19 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <danny@leakix.net>"]

[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
Expand Down Expand Up @@ -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"
Loading