Skip to content

Commit 9ce1ae3

Browse files
committed
Merge branch 'master' into feat/sign-public-url
2 parents 208a253 + 7fab015 commit 9ce1ae3

25 files changed

+3747
-4010
lines changed

.github/workflows/build_and_deploy_docs.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
env:
1010
NODE_VERSION: 22
11-
PYTHON_VERSION: 3.12
11+
PYTHON_VERSION: 3.13
1212

1313
jobs:
1414
build_and_deploy_docs:
@@ -54,10 +54,13 @@ jobs:
5454
with:
5555
python-version: ${{ env.PYTHON_VERSION }}
5656

57+
- name: Set up uv package manager
58+
uses: astral-sh/setup-uv@v5
59+
with:
60+
python-version: ${{ env.PYTHON_VERSION }}
61+
5762
- name: Install Python dependencies
58-
run: |
59-
pipx install --python ${{ env.PYTHON_VERSION }} poetry
60-
make install-dev
63+
run: make install-dev
6164

6265
- name: Build generated API reference
6366
run: make build-api-reference

.github/workflows/release.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
release_metadata:
2626
name: Prepare release metadata
2727
runs-on: ubuntu-latest
28-
outputs:
28+
outputs:
2929
version_number: ${{ steps.release_metadata.outputs.version_number }}
3030
tag_name: ${{ steps.release_metadata.outputs.tag_name }}
3131
changelog: ${{ steps.release_metadata.outputs.changelog }}
@@ -63,7 +63,7 @@ jobs:
6363
with:
6464
version_number: ${{ needs.release_metadata.outputs.version_number }}
6565
changelog: ${{ needs.release_metadata.outputs.changelog }}
66-
secrets:
66+
secrets:
6767
APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
6868

6969
create_github_release:
@@ -94,7 +94,7 @@ jobs:
9494
steps:
9595
- name: Prepare distribution
9696
uses: apify/workflows/prepare-pypi-distribution@main
97-
with:
97+
with:
9898
package_name: apify
9999
is_prerelease: ""
100100
version_number: ${{ needs.release_metadata.outputs.version_number }}

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ __pycache__
1010
.envrc
1111
.python-version
1212

13-
# Poetry
14-
poetry.toml
15-
1613
# Mise
1714
mise.toml
1815
.mise.toml

CHANGELOG.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,27 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
<!-- git-cliff-unreleased-start -->
6-
## 2.3.0 - **not yet released**
5+
## [2.3.1](https://github.com/apify/apify-sdk-python/releases/tag/v2.3.1) (2025-02-25)
6+
7+
### 🐛 Bug Fixes
8+
9+
- Allow None value in &#x27;inputBodyLen&#x27; in ActorRunStats ([#413](https://github.com/apify/apify-sdk-python/pull/413)) ([1cf37f1](https://github.com/apify/apify-sdk-python/commit/1cf37f13f8db1313ac82276d13200af4aa2bf773)) by [@janbuchar](https://github.com/janbuchar)
10+
11+
12+
## [2.3.0](https://github.com/apify/apify-sdk-python/releases/tag/v2.3.0) (2025-02-19)
713

814
### 🚀 Features
915

1016
- Add `rate_limit_errors` property for `ApifyStorageClient` ([#387](https://github.com/apify/apify-sdk-python/pull/387)) ([89c230a](https://github.com/apify/apify-sdk-python/commit/89c230a21a1a8698159975f97c73a724b9063278)) by [@Mantisus](https://github.com/Mantisus), closes [#318](https://github.com/apify/apify-sdk-python/issues/318)
1117
- Unify Apify and Scrapy to use single event loop &amp; remove `nest-asyncio` ([#390](https://github.com/apify/apify-sdk-python/pull/390)) ([96949be](https://github.com/apify/apify-sdk-python/commit/96949be4f7687ac9285992d1fb02ac6172307bdb)) by [@vdusek](https://github.com/vdusek), closes [#148](https://github.com/apify/apify-sdk-python/issues/148), [#176](https://github.com/apify/apify-sdk-python/issues/176), [#392](https://github.com/apify/apify-sdk-python/issues/392)
18+
- Support pay-per-event via `Actor.charge` ([#393](https://github.com/apify/apify-sdk-python/pull/393)) ([78888c4](https://github.com/apify/apify-sdk-python/commit/78888c4d6258211cdbc5fd5b5cbadbf23c39d818)) by [@janbuchar](https://github.com/janbuchar), closes [#374](https://github.com/apify/apify-sdk-python/issues/374)
1219

1320
### 🐛 Bug Fixes
1421

1522
- Fix RQ usage in Scrapy scheduler ([#385](https://github.com/apify/apify-sdk-python/pull/385)) ([3363478](https://github.com/apify/apify-sdk-python/commit/3363478dbf6eb35e45c237546fe0df5c104166f6)) by [@vdusek](https://github.com/vdusek)
1623
- Make sure that Actor instances with non-default configurations are also accessible through the global Actor proxy after initialization ([#402](https://github.com/apify/apify-sdk-python/pull/402)) ([b956a02](https://github.com/apify/apify-sdk-python/commit/b956a02d0ba59e0cfde489cc13ca92d7f8f8c84f)) by [@janbuchar](https://github.com/janbuchar), closes [#397](https://github.com/apify/apify-sdk-python/issues/397)
1724

1825

19-
<!-- git-cliff-unreleased-end -->
2026
## [2.2.1](https://github.com/apify/apify-sdk-python/releases/tag/v2.2.1) (2025-01-17)
2127

2228
### 🐛 Bug Fixes

CONTRIBUTING.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Here you'll find a contributing guide to get started with development.
66

77
For local development, it is required to have Python 3.9 (or a later version) installed.
88

9-
We use [Poetry](https://python-poetry.org/) for project management. Install it and set up your IDE accordingly.
9+
We use [uv](https://docs.astral.sh/uv/) for project management. Install it and set up your IDE accordingly.
1010

1111
## Dependencies
1212

@@ -139,28 +139,22 @@ Publishing new versions to [PyPI](https://pypi.org/project/apify) is automated t
139139

140140
3. Update the version number:
141141

142-
- Modify the `version` field under `tool.poetry` in `pyproject.toml`.
142+
- Modify the `version` field under `project` in `pyproject.toml`.
143143

144144
```toml
145-
[tool.poetry]
145+
[project]
146146
name = "apify"
147147
version = "x.z.y"
148148
```
149149

150150
4. Generate the distribution archives for the package:
151151

152152
```shell
153-
poetry build
153+
uv build
154154
```
155155

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

158158
```shell
159-
poetry config pypi-token.pypi YOUR_API_TOKEN
160-
```
161-
162-
6. Upload the package to PyPI:
163-
164-
```shell
165-
poetry publish
159+
uv publish --token YOUR_API_TOKEN
166160
```

Makefile

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.PHONY: clean install-dev build publish-to-pypi lint type-check unit-tests unit-tests-cov \
2-
integration-tests format check-code build-api-reference build-docs run-docs
2+
integration-tests format check-code build-api-reference build-docs run-docs
33

44
# This is default for local testing, but GitHub workflows override it to a higher value in CI
55
INTEGRATION_TESTS_CONCURRENCY = 1
@@ -8,46 +8,45 @@ clean:
88
rm -rf .mypy_cache .pytest_cache .ruff_cache build dist htmlcov .coverage
99

1010
install-dev:
11-
poetry install --all-extras
12-
poetry run pre-commit install
11+
uv sync --all-extras
12+
uv run pre-commit install
1313

1414
build:
15-
poetry build --no-interaction -vv
15+
uv build --verbose
1616

1717
# APIFY_PYPI_TOKEN_CRAWLEE is expected to be set in the environment
1818
publish-to-pypi:
19-
poetry config pypi-token.pypi "${APIFY_PYPI_TOKEN_CRAWLEE}"
20-
poetry publish --no-interaction -vv
19+
uv publish --verbose --token "${APIFY_PYPI_TOKEN_CRAWLEE}"
2120

2221
lint:
23-
poetry run ruff format --check
24-
poetry run ruff check
22+
uv run ruff format --check
23+
uv run ruff check
2524

2625
type-check:
27-
poetry run mypy
26+
uv run mypy
2827

2928
unit-tests:
30-
poetry run pytest --numprocesses=auto --verbose --cov=src/apify tests/unit
29+
uv run pytest --numprocesses=auto --verbose --cov=src/apify tests/unit
3130

3231
unit-tests-cov:
33-
poetry run pytest --numprocesses=auto --verbose --cov=src/apify --cov-report=html tests/unit
32+
uv run pytest --numprocesses=auto --verbose --cov=src/apify --cov-report=html tests/unit
3433

3534
integration-tests:
36-
poetry run pytest --numprocesses=$(INTEGRATION_TESTS_CONCURRENCY) --verbose tests/integration
35+
uv run pytest --numprocesses=$(INTEGRATION_TESTS_CONCURRENCY) --verbose tests/integration
3736

3837
format:
39-
poetry run ruff check --fix
40-
poetry run ruff format
38+
uv run ruff check --fix
39+
uv run ruff format
4140

4241
# The check-code target runs a series of checks equivalent to those performed by pre-commit hooks
4342
# and the run_checks.yaml GitHub Actions workflow.
4443
check-code: lint type-check unit-tests
4544

4645
build-api-reference:
47-
cd website && poetry run ./build_api_reference.sh
46+
cd website && uv run ./build_api_reference.sh
4847

4948
build-docs:
50-
cd website && poetry run npm clean-install && poetry run npm run build
49+
cd website && uv run npm clean-install && uv run npm run build
5150

5251
run-docs: build-api-reference
53-
cd website && poetry run npm clean-install && poetry run npm run start
52+
cd website && uv run npm clean-install && uv run npm run start

docs/02_guides/code/scrapy_project/src/__main__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
from __future__ import annotations
22

3-
from twisted.internet import asyncioreactor
3+
from scrapy.utils.reactor import install_reactor
44

55
# Install Twisted's asyncio reactor before importing any other Twisted or
66
# Scrapy components.
7-
asyncioreactor.install() # type: ignore[no-untyped-call]
7+
install_reactor('twisted.internet.asyncioreactor.AsyncioSelectorReactor')
88

99
import os
1010

docs/02_guides/code/scrapy_project/src/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
ROBOTSTXT_OBEY = True
66
SPIDER_MODULES = ['src.spiders']
77
TELNETCONSOLE_ENABLED = False
8+
# Do not change the Twisted reactor unless you really know what you are doing.
89
TWISTED_REACTOR = 'twisted.internet.asyncioreactor.AsyncioSelectorReactor'
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
from .title import TitleSpider
2+
3+
__all__ = ['TitleSpider']

docs/02_guides/code/scrapy_project/src/spiders/title.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
if TYPE_CHECKING:
1111
from collections.abc import Generator
1212

13-
from scrapy.responsetypes import Response
13+
from scrapy.http.response import Response
1414

1515

1616
class TitleSpider(Spider):

0 commit comments

Comments
 (0)