Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ repos:
hooks:
- id: lint-check
name: Lint check
entry: make lint
entry: uv run poe lint
language: system
pass_filenames: false

- id: type-check
name: Type check
entry: make type-check
entry: uv run poe type-check
language: system
pass_filenames: false
17 changes: 10 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,23 @@ For local development, it is required to have Python 3.10 (or a later version) i

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

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

## Dependencies

To install this package and its development dependencies, run:

```sh
make install-dev
uv run poe install-dev
```

## Code checking

To execute all code checking tools together, run:

```sh
make check-code
uv run poe check-code
```

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

```sh
make lint
uv run poe lint
```

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

```sh
make format
uv run poe format
```

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

```sh
make type-check
uv run poe type-check
```

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

```sh
make unit-tests
uv run poe unit-tests
```

To run unit tests with HTML coverage report:

```sh
make unit-tests-cov
uv run poe unit-tests-cov
```

## Release process
Expand Down
36 changes: 0 additions & 36 deletions Makefile

This file was deleted.

19 changes: 19 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ dependencies = []
[dependency-groups]
dev = [
"dycw-pytest-only~=2.1.0",
"poethepoet<1.0.0",
"pre-commit~=4.3.0",
"pytest-asyncio~=1.1.0",
"pytest-cov~=6.2.0",
Expand Down Expand Up @@ -104,3 +105,21 @@ python-version = "3.10"

[tool.ty.src]
include = ["src", "tests", "scripts", "docs", "website"]

# Run tasks with: uv run poe <task>
[tool.poe.tasks]
clean = "rm -rf .coverage .pytest_cache .ruff_cache .ty_cache build dist htmlcov"
install-sync = "uv sync --all-extras"
install-dev = "uv sync --all-extras"
build = "uv build --verbose"
publish-to-pypi = "uv publish --verbose --token ${APIFY_PYPI_TOKEN_CRAWLEE}"
type-check = "uv run ty check"
unit-tests = "uv run pytest --numprocesses=auto --verbose --cov=src/apify_shared tests/unit"
unit-tests-cov = "uv run pytest --numprocesses=auto --verbose --cov=src/apify_shared --cov-report=html tests/unit"
check-code = ["lint", "type-check", "unit-tests"]

[tool.poe.tasks.lint]
shell = "uv run ruff format --check && uv run ruff check"

[tool.poe.tasks.format]
shell = "uv run ruff check --fix && uv run ruff format"
Loading
Loading