Skip to content

Commit f9c13e7

Browse files
committed
Merge branch 'master' into add-use-state
2 parents f7aca0c + 2179ec9 commit f9c13e7

18 files changed

Lines changed: 3670 additions & 1436 deletions

File tree

.github/workflows/_check_code.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ jobs:
2424
- name: Checkout repository
2525
uses: actions/checkout@v6
2626
- name: Check spelling with typos
27-
uses: crate-ci/typos@v1.42.0
27+
uses: crate-ci/typos@v1.42.1
2828

2929
lint_check:
3030
name: Lint check
3131
uses: apify/workflows/.github/workflows/python_lint_check.yaml@main
3232
with:
33-
python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'
33+
python_versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'
3434

3535
type_check:
3636
name: Type check
3737
uses: apify/workflows/.github/workflows/python_type_check.yaml@main
3838
with:
39-
python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'
39+
python_versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'

.github/workflows/_release_docs.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,10 @@ jobs:
6868
python-version: ${{ env.PYTHON_VERSION }}
6969

7070
- name: Install Python dependencies
71-
run: make install-dev
71+
run: uv run poe install-dev
7272

73-
- name: Build generated API reference
74-
run: make build-api-reference
75-
76-
- name: Build Docusaurus docs
77-
run: make build-docs
73+
- name: Build docs
74+
run: uv run poe build-docs
7875
env:
7976
APIFY_SIGNING_TOKEN: ${{ secrets.APIFY_SIGNING_TOKEN }}
8077

.github/workflows/_tests.yaml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,19 @@ jobs:
1313
uses: apify/workflows/.github/workflows/python_unit_tests.yaml@main
1414
secrets: inherit
1515
with:
16-
python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'
17-
operating-systems: '["ubuntu-latest", "windows-latest"]'
18-
python-version-for-codecov: "3.14"
19-
operating-system-for-codecov: ubuntu-latest
16+
python_versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'
17+
operating_systems: '["ubuntu-latest", "windows-latest"]'
18+
python_version_for_codecov: "3.14"
19+
operating_system_for_codecov: ubuntu-latest
20+
tests_concurrency: "1"
2021

2122
integration_tests:
2223
name: Integration tests
2324
uses: apify/workflows/.github/workflows/python_integration_tests.yaml@main
2425
secrets: inherit
2526
with:
26-
python-versions: '["3.10", "3.14"]'
27-
operating-systems: '["ubuntu-latest"]'
28-
python-version-for-codecov: "3.14"
29-
operating-system-for-codecov: ubuntu-latest
27+
python_versions: '["3.10", "3.14"]'
28+
operating_systems: '["ubuntu-latest"]'
29+
python_version_for_codecov: "3.14"
30+
operating_system_for_codecov: ubuntu-latest
31+
tests_concurrency: "16"

.gitignore

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,40 @@
1+
# AI assistant files
2+
.agent
3+
.agents
4+
.ai
5+
.aider
6+
.claude
7+
.codeium
8+
.continue
9+
.copilot
10+
.cursor
11+
.gemini
12+
.llm
13+
.llms
14+
.openai
15+
.serena
16+
.windsurf
17+
.zed-ai
18+
AGENTS.md
19+
CLAUDE.md
20+
GEMINI.md
21+
122
# Cache
223
__pycache__
3-
.mypy_cache
424
.pytest_cache
525
.ruff_cache
626
.ty_cache
727
.uv-cache
828

929
# Virtual envs
10-
.venv
1130
.direnv
31+
.env
1232
.envrc
1333
.python-version
34+
.venv
35+
36+
# Other Python tools
37+
.ropeproject
1438

1539
# Mise
1640
mise.toml
@@ -29,10 +53,12 @@ coverage-unit.xml
2953
coverage-integration.xml
3054

3155
# IDE, editors
32-
.vscode
33-
.idea
56+
*~
3457
.DS_Store
58+
.idea
3559
.nvim.lua
60+
.vscode
61+
.zed
3662
Session.vim
3763

3864
# Docs
@@ -51,3 +77,6 @@ website/typedoc-types*
5177

5278
# Default directory for memory storage
5379
storage/
80+
81+
# Tmp dir
82+
tmp/

.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: 45 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,41 @@ 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+
14+
### Available tasks
15+
16+
| Task | Description |
17+
| ---- | ----------- |
18+
| `install-dev` | Install development dependencies |
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 website locally |
29+
| `build` | Build package |
30+
| `clean` | Remove build artifacts and clean caches |
31+
1132
## Dependencies
1233

1334
To install this package and its development dependencies, run:
1435

1536
```sh
16-
make install-dev
37+
uv run poe install-dev
1738
```
1839

1940
## Code checking
2041

2142
To execute all code checking tools together, run:
2243

2344
```sh
24-
make check-code
45+
uv run poe check-code
2546
```
2647

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

3354
```sh
34-
make lint
55+
uv run poe lint
3556
```
3657

3758
### Formatting
@@ -41,7 +62,7 @@ Our automated code formatting also leverages [ruff](https://docs.astral.sh/ruff/
4162
To run formatting:
4263

4364
```sh
44-
make format
65+
uv run poe format
4566
```
4667

4768
### Type checking
@@ -51,78 +72,50 @@ Type checking is handled by [ty](https://docs.astral.sh/ty/), verifying code aga
5172
To run type checking:
5273

5374
```sh
54-
make type-check
75+
uv run poe type-check
5576
```
5677

5778
### Unit tests
5879

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

6382
To run unit tests:
6483

6584
```sh
66-
make unit-tests
85+
uv run poe unit-tests
6786
```
6887

69-
To run unit tests with HTML coverage report:
88+
To run unit tests with XML coverage report:
7089

7190
```sh
72-
make unit-tests-cov
91+
uv run poe unit-tests-cov
7392
```
7493

7594
## Integration tests
7695

77-
We have integration tests which build and run Actors using the Python SDK on the Apify Platform. To run these tests,
78-
you need to set the `APIFY_TEST_USER_API_TOKEN` environment variable to the API token of the Apify user you want to
79-
use for the tests, and then start them with `make integration-tests`.
80-
81-
If you want to run the integration tests on a different environment than the main Apify Platform, you need to set
82-
the `APIFY_INTEGRATION_TESTS_API_URL` environment variable to the right URL to the Apify API you want to use.
83-
84-
## Documentation
85-
86-
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/).
87-
88-
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.
89-
90-
To run the documentation locally, you need to have Node.js version 20 or higher installed. Once you have the correct version of Node.js, follow these steps:
91-
92-
Navigate to the `website/` directory:
93-
94-
```sh
95-
cd website/
96-
```
96+
We have integration tests which build and run Actors using the Python SDK on the Apify platform.
9797

98-
Enable Corepack, which installs Yarn automatically:
98+
Prerequisites:
9999

100-
```sh
101-
corepack enable
102-
```
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
103102

104-
Build the API reference:
103+
To run integration tests:
105104

106105
```sh
107-
./build_api_reference.sh
106+
uv run poe integration-tests
108107
```
109108

110-
Install the necessary dependencies:
111-
112-
```sh
113-
yarn
114-
```
109+
## Documentation
115110

116-
Start the project in development mode with Hot Module Replacement (HMR):
111+
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/).
117112

118-
```sh
119-
yarn start
120-
```
113+
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.
121114

122-
Or using `make`:
115+
To run the documentation locally (requires Node.js):
123116

124117
```sh
125-
make run-doc
118+
uv run poe run-docs
126119
```
127120

128121
## Release process
@@ -147,14 +140,14 @@ name = "apify"
147140
version = "x.z.y"
148141
```
149142

150-
4. Generate the distribution archives for the package:
143+
4. Build the package:
151144

152-
```shell
153-
uv build
145+
```sh
146+
uv run poe build
154147
```
155148

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

158-
```shell
151+
```sh
159152
uv publish --token YOUR_API_TOKEN
160153
```

Makefile

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

0 commit comments

Comments
 (0)