Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 7 additions & 4 deletions .github/workflows/build_and_deploy_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

env:
NODE_VERSION: 22
PYTHON_VERSION: 3.12
PYTHON_VERSION: 3.13

jobs:
build_and_deploy_docs:
Expand Down Expand Up @@ -54,10 +54,13 @@ jobs:
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Set up uv package manager
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install Python dependencies
run: |
pipx install --python ${{ env.PYTHON_VERSION }} poetry
make install-dev
run: make install-dev

- name: Build generated API reference
run: make build-api-reference
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/pre_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,33 @@ jobs:
changelog: ${{ steps.release_metadata.outputs.changelog }}
existing_changelog_path: CHANGELOG.md
steps:
- uses: apify/workflows/git-cliff-release@main
- uses: apify/workflows/git-cliff-release@switch-to-uv
id: release_metadata
name: Prepare release metadata
with:
release_type: prerelease

lint_check:
name: Lint check
uses: apify/workflows/.github/workflows/python_lint_check.yaml@main
uses: apify/workflows/.github/workflows/python_lint_check.yaml@switch-to-uv

type_check:
name: Type check
uses: apify/workflows/.github/workflows/python_type_check.yaml@main
uses: apify/workflows/.github/workflows/python_type_check.yaml@switch-to-uv

unit_tests:
name: Unit tests
uses: apify/workflows/.github/workflows/python_unit_tests.yaml@main
uses: apify/workflows/.github/workflows/python_unit_tests.yaml@switch-to-uv

integration_tests:
name: Integration tests
uses: apify/workflows/.github/workflows/python_integration_tests.yaml@main
uses: apify/workflows/.github/workflows/python_integration_tests.yaml@switch-to-uv
secrets: inherit

update_changelog:
name: Update changelog
needs: [release_metadata, lint_check, type_check, unit_tests, integration_tests]
uses: apify/workflows/.github/workflows/python_bump_and_update_changelog.yaml@main
uses: apify/workflows/.github/workflows/python_bump_and_update_changelog.yaml@switch-to-uv
with:
version_number: ${{ needs.release_metadata.outputs.version_number }}
changelog: ${{ needs.release_metadata.outputs.changelog }}
Expand All @@ -67,7 +67,7 @@ jobs:
url: https://pypi.org/project/apify
steps:
- name: Prepare distribution
uses: apify/workflows/prepare-pypi-distribution@main
uses: apify/workflows/prepare-pypi-distribution@switch-to-uv
with:
package_name: apify
is_prerelease: "yes"
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
changelog: ${{ steps.release_metadata.outputs.changelog }}
release_notes: ${{ steps.release_metadata.outputs.release_notes }}
steps:
- uses: apify/workflows/git-cliff-release@main
- uses: apify/workflows/git-cliff-release@switch-to-uv
name: Prepare release metadata
id: release_metadata
with:
Expand All @@ -41,25 +41,25 @@ jobs:

lint_check:
name: Lint check
uses: apify/workflows/.github/workflows/python_lint_check.yaml@main
uses: apify/workflows/.github/workflows/python_lint_check.yaml@switch-to-uv

type_check:
name: Type check
uses: apify/workflows/.github/workflows/python_type_check.yaml@main
uses: apify/workflows/.github/workflows/python_type_check.yaml@switch-to-uv

unit_tests:
name: Unit tests
uses: apify/workflows/.github/workflows/python_unit_tests.yaml@main
uses: apify/workflows/.github/workflows/python_unit_tests.yaml@switch-to-uv

integration_tests:
name: Integration tests
uses: apify/workflows/.github/workflows/python_integration_tests.yaml@main
uses: apify/workflows/.github/workflows/python_integration_tests.yaml@switch-to-uv
secrets: inherit

update_changelog:
name: Update changelog
needs: [release_metadata, lint_check, type_check, unit_tests, integration_tests]
uses: apify/workflows/.github/workflows/python_bump_and_update_changelog.yaml@main
uses: apify/workflows/.github/workflows/python_bump_and_update_changelog.yaml@switch-to-uv
with:
version_number: ${{ needs.release_metadata.outputs.version_number }}
changelog: ${{ needs.release_metadata.outputs.changelog }}
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
url: https://pypi.org/project/apify
steps:
- name: Prepare distribution
uses: apify/workflows/prepare-pypi-distribution@main
uses: apify/workflows/prepare-pypi-distribution@switch-to-uv
with:
package_name: apify
is_prerelease: ""
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/run_code_checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ on:
jobs:
lint_check:
name: Lint check
uses: apify/workflows/.github/workflows/python_lint_check.yaml@main
uses: apify/workflows/.github/workflows/python_lint_check.yaml@switch-to-uv

type_check:
name: Type check
uses: apify/workflows/.github/workflows/python_type_check.yaml@main
uses: apify/workflows/.github/workflows/python_type_check.yaml@switch-to-uv

unit_tests:
name: Unit tests
uses: apify/workflows/.github/workflows/python_unit_tests.yaml@main
uses: apify/workflows/.github/workflows/python_unit_tests.yaml@switch-to-uv

docs_check:
name: Docs check
uses: apify/workflows/.github/workflows/python_docs_check.yaml@main
uses: apify/workflows/.github/workflows/python_docs_check.yaml@switch-to-uv

integration_tests:
name: Integration tests
needs: [lint_check, type_check, unit_tests]
uses: apify/workflows/.github/workflows/python_integration_tests.yaml@main
uses: apify/workflows/.github/workflows/python_integration_tests.yaml@switch-to-uv
secrets: inherit
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ __pycache__
.envrc
.python-version

# Poetry
poetry.toml

# Mise
mise.toml
.mise.toml
Expand Down
18 changes: 6 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Here you'll find a contributing guide to get started with development.

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

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

## Dependencies

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

3. Update the version number:

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

```toml
[tool.poetry]
[project]
name = "apify"
version = "x.z.y"
```

4. Generate the distribution archives for the package:

```shell
poetry build
uv build
```

5. Set up the PyPI API token for authentication:
5. Set up the PyPI API token for authentication and upload the package to PyPI:

```shell
poetry config pypi-token.pypi YOUR_API_TOKEN
```

6. Upload the package to PyPI:

```shell
poetry publish
uv publish --token YOUR_API_TOKEN
```
33 changes: 16 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.PHONY: clean install-dev build publish-to-pypi lint type-check unit-tests unit-tests-cov \
integration-tests format check-code build-api-reference build-docs run-docs
integration-tests format check-code build-api-reference build-docs run-docs

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

install-dev:
poetry install --all-extras
poetry run pre-commit install
uv sync --all-extras
uv run pre-commit install

build:
poetry build --no-interaction -vv
uv build --verbose

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

lint:
poetry run ruff format --check
poetry run ruff check
uv run ruff format --check
uv run ruff check

type-check:
poetry run mypy
uv run mypy

unit-tests:
poetry run pytest --numprocesses=auto --verbose --cov=src/apify tests/unit
uv run pytest --numprocesses=auto --verbose --cov=src/apify tests/unit

unit-tests-cov:
poetry run pytest --numprocesses=auto --verbose --cov=src/apify --cov-report=html tests/unit
uv run pytest --numprocesses=auto --verbose --cov=src/apify --cov-report=html tests/unit

integration-tests:
poetry run pytest --numprocesses=$(INTEGRATION_TESTS_CONCURRENCY) --verbose tests/integration
uv run pytest --numprocesses=$(INTEGRATION_TESTS_CONCURRENCY) --verbose tests/integration

format:
poetry run ruff check --fix
poetry run ruff format
uv run ruff check --fix
uv run ruff format

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

build-api-reference:
cd website && poetry run ./build_api_reference.sh
cd website && uv run ./build_api_reference.sh

build-docs:
cd website && poetry run npm clean-install && poetry run npm run build
cd website && uv run npm clean-install && uv run npm run build

run-docs: build-api-reference
cd website && poetry run npm clean-install && poetry run npm run start
cd website && uv run npm clean-install && uv run npm run start
Loading
Loading