Skip to content

Commit 72f7949

Browse files
committed
chore: Replace Makefile with poethepoet task runner
1 parent 2b10c8d commit 72f7949

File tree

5 files changed

+114
-83
lines changed

5 files changed

+114
-83
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ repos:
33
hooks:
44
- id: lint-check
55
name: Lint check
6-
entry: make lint
6+
entry: uv run poe lint
77
language: system
88
pass_filenames: false
99

1010
- id: type-check
1111
name: Type check
12-
entry: make type-check
12+
entry: uv run poe type-check
1313
language: system
1414
pass_filenames: false

CONTRIBUTING.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,23 @@ For local development, it is required to have Python 3.10 (or a later version) i
88

99
We use [uv](https://docs.astral.sh/uv/) for project management. Install it and set up your IDE accordingly.
1010

11+
We use [Poe the Poet](https://poethepoet.natn.io/) as a task runner, similar to npm scripts in `package.json`.
12+
All tasks are defined in `pyproject.toml` under `[tool.poe.tasks]` and can be run with `uv run poe <task>`.
13+
1114
## Dependencies
1215

1316
To install this package and its development dependencies, run:
1417

1518
```sh
16-
make install-dev
19+
uv run poe install-dev
1720
```
1821

1922
## Code checking
2023

2124
To execute all code checking tools together, run:
2225

2326
```sh
24-
make check-code
27+
uv run poe check-code
2528
```
2629

2730
### Linting
@@ -31,7 +34,7 @@ We utilize [ruff](https://docs.astral.sh/ruff/) for linting, which analyzes code
3134
To run linting:
3235

3336
```sh
34-
make lint
37+
uv run poe lint
3538
```
3639

3740
### Formatting
@@ -41,7 +44,7 @@ Our automated code formatting also leverages [ruff](https://docs.astral.sh/ruff/
4144
To run formatting:
4245

4346
```sh
44-
make format
47+
uv run poe format
4548
```
4649

4750
### Type checking
@@ -51,7 +54,7 @@ Type checking is handled by [ty](https://docs.astral.sh/ty/), verifying code aga
5154
To run type checking:
5255

5356
```sh
54-
make type-check
57+
uv run poe type-check
5558
```
5659

5760
### Unit tests
@@ -63,13 +66,13 @@ We use [pytest](https://docs.pytest.org/) as a testing framework with many plugi
6366
To run unit tests:
6467

6568
```sh
66-
make unit-tests
69+
uv run poe unit-tests
6770
```
6871

6972
To run unit tests with HTML coverage report:
7073

7174
```sh
72-
make unit-tests-cov
75+
uv run poe unit-tests-cov
7376
```
7477

7578
## Release process

Makefile

Lines changed: 0 additions & 36 deletions
This file was deleted.

pyproject.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ dependencies = []
4444
[dependency-groups]
4545
dev = [
4646
"dycw-pytest-only~=2.1.0",
47+
"poethepoet<1.0.0",
4748
"pre-commit~=4.3.0",
4849
"pytest-asyncio~=1.1.0",
4950
"pytest-cov~=6.2.0",
@@ -104,3 +105,21 @@ python-version = "3.10"
104105

105106
[tool.ty.src]
106107
include = ["src", "tests", "scripts", "docs", "website"]
108+
109+
# Run tasks with: uv run poe <task>
110+
[tool.poe.tasks]
111+
clean = "rm -rf .coverage .pytest_cache .ruff_cache .ty_cache build dist htmlcov"
112+
install-sync = "uv sync --all-extras"
113+
install-dev = "uv sync --all-extras"
114+
build = "uv build --verbose"
115+
publish-to-pypi = "uv publish --verbose --token ${APIFY_PYPI_TOKEN_CRAWLEE}"
116+
type-check = "uv run ty check"
117+
unit-tests = "uv run pytest --numprocesses=auto --verbose --cov=src/apify_shared tests/unit"
118+
unit-tests-cov = "uv run pytest --numprocesses=auto --verbose --cov=src/apify_shared --cov-report=html tests/unit"
119+
check-code = ["lint", "type-check", "unit-tests"]
120+
121+
[tool.poe.tasks.lint]
122+
shell = "uv run ruff format --check && uv run ruff check"
123+
124+
[tool.poe.tasks.format]
125+
shell = "uv run ruff check --fix && uv run ruff format"

0 commit comments

Comments
 (0)