Skip to content

Commit 1d31816

Browse files
committed
Update contributing guide
1 parent 07ad47a commit 1d31816

File tree

2 files changed

+36
-14
lines changed

2 files changed

+36
-14
lines changed

CONTRIBUTING.md

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,24 @@ We use [uv](https://docs.astral.sh/uv/) for project management. Install it and s
1111
We use [Poe the Poet](https://poethepoet.natn.io/) as a task runner, similar to npm scripts in `package.json`.
1212
All tasks are defined in `pyproject.toml` under `[tool.poe.tasks]` and can be run with `uv run poe <task>`.
1313

14+
### Available tasks
15+
16+
| Task | Description |
17+
| ---- | ----------- |
18+
| `install-dev` | Install dependencies and pre-commit hooks |
19+
| `check-code` | Run lint, type-check, and unit-tests |
20+
| `lint` | Run linter |
21+
| `format` | Fix lint issues and format code |
22+
| `type-check` | Run type checker |
23+
| `unit-tests` | Run unit tests |
24+
| `unit-tests-cov` | Run unit tests with coverage |
25+
| `integration-tests` | Run integration tests |
26+
| `integration-tests-cov` | Run integration tests with coverage |
27+
| `build-docs` | Build documentation website |
28+
| `run-docs` | Run documentation locally |
29+
| `build` | Build package |
30+
| `clean` | Remove build artifacts |
31+
1432
## Dependencies
1533

1634
To install this package and its development dependencies, run:
@@ -59,8 +77,6 @@ uv run poe type-check
5977

6078
### Unit tests
6179

62-
We employ pytest as our testing framework, equipped with various plugins. Check pyproject.toml for configuration details and installed plugins.
63-
6480
We use [pytest](https://docs.pytest.org/) as a testing framework with many plugins. Check `pyproject.toml` for configuration details and installed plugins.
6581

6682
To run unit tests:
@@ -77,20 +93,26 @@ uv run poe unit-tests-cov
7793

7894
## Integration tests
7995

80-
We have integration tests which build and run Actors using the Python SDK on the Apify Platform. To run these tests,
81-
you need to set the `APIFY_TEST_USER_API_TOKEN` environment variable to the API token of the Apify user you want to
82-
use for the tests, and then start them with `uv run poe integration-tests`.
96+
We have integration tests which build and run Actors using the Python SDK on the Apify platform.
97+
98+
Prerequisites:
8399

84-
If you want to run the integration tests on a different environment than the main Apify Platform, you need to set
85-
the `APIFY_INTEGRATION_TESTS_API_URL` environment variable to the right URL to the Apify API you want to use.
100+
- Set `APIFY_TEST_USER_API_TOKEN` to your Apify API token
101+
- Optionally set `APIFY_INTEGRATION_TESTS_API_URL` to use a different Apify API environment
102+
103+
To run integration tests:
104+
105+
```sh
106+
uv run poe integration-tests
107+
```
86108

87109
## Documentation
88110

89111
We adhere to the [Google docstring format](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html) for documenting our codebase. Every user-facing class or method is documented. Documentation standards are enforced using [Ruff](https://docs.astral.sh/ruff/).
90112

91113
Our API documentation is generated from these docstrings using [pydoc-markdown](https://pypi.org/project/pydoc-markdown/) with additional post-processing. Markdown files in the `docs/` folder complement the autogenerated content. Final documentation is rendered using [Docusaurus](https://docusaurus.io/) and published to GitHub Pages.
92114

93-
To run the documentation locally:
115+
To run the documentation locally (requires Node.js):
94116

95117
```sh
96118
uv run poe run-docs
@@ -118,14 +140,14 @@ name = "apify"
118140
version = "x.z.y"
119141
```
120142

121-
4. Generate the distribution archives for the package:
143+
4. Build the package:
122144

123-
```shell
124-
uv build
145+
```sh
146+
uv run poe build
125147
```
126148

127-
5. Set up the PyPI API token for authentication and upload the package to PyPI:
149+
5. Upload to PyPI:
128150

129-
```shell
151+
```sh
130152
uv publish --token YOUR_API_TOKEN
131153
```

docs/02_concepts/12_pay_per_event.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ When you plan to start using the pay-per-event pricing model for an Actor that i
4343

4444
It is encouraged to test your monetization code on your machine before releasing it to the public. To tell your Actor that it should work in pay-per-event mode, pass it the `ACTOR_TEST_PAY_PER_EVENT` environment variable:
4545

46-
```shell
46+
```sh
4747
ACTOR_TEST_PAY_PER_EVENT=true python -m youractor
4848
```
4949

0 commit comments

Comments
 (0)