Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
14 changes: 14 additions & 0 deletions .github/workflows/check_pr_title.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Check PR title

on:
pull_request_target:
types: [opened, edited, synchronize]

jobs:
check_pr_title:
name: Check PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12 changes: 4 additions & 8 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,12 @@ jobs:
if: steps.get-release-type.outputs.release_type != 'final'
run: python ./scripts/update_version_for_prerelease.py ${{ steps.get-release-type.outputs.release_type }}

- # Build a source distribution and a python3-only wheel
name: Build distribution files
# Builds the package.
- name: Build package
run: make build

- # Check whether the package description will render correctly on PyPI
name: Check package rendering on PyPI
run: make twine-check

- # Publish package to PyPI using their official GitHub action
name: Publish package to PyPI
# Publishes the package to PyPI using PyPA official GitHub action with OIDC authentication.
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

- # Tag the current commit with the version tag if this is not made from the release event (releases are tagged with the release process)
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/update_new_issue.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Update new issue

on:
workflow_call:

jobs:
label_issues:
name: Label issues
runs-on: ubuntu-latest
permissions:
issues: write

steps:
# Add the "t-tooling" label to all new issues
- uses: actions/github-script@v7
with:
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["t-tooling"]
})
10 changes: 8 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@ repos:
language: system
pass_filenames: false

- id: check-changelog
name: Check whether current version is mentioned in changelog
- id: check-changelog-entry
name: Check changelog entry
entry: make check-changelog-entry
language: system
pass_filenames: false

- id: check-version-conflict
name: Check version conflict
entry: make check-version-conflict
language: system
pass_filenames: false
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## [1.7.3](../../releases/tag/v1.7.3) - Unreleased
## [2.0.0](../../releases/tag/v2.0.0) - Unreleased

### Added

Expand Down
51 changes: 28 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,53 +1,58 @@
.PHONY: clean install-dev build publish twine-check lint unit-tests integration-tests type-check check-code format check-version-availability check-changelog-entry build-api-reference
.PHONY: clean install-dev build publish-to-pypi lint type-check unit-tests unit-tests-cov integration-tests format check-code check-version-availability check-changelog-entry build-api-reference run-doc

DIRS_WITH_CODE = src tests scripts

# This is default for local testing, but GitHub workflows override it to a higher value in CI
INTEGRATION_TESTS_CONCURRENCY = 1

clean:
rm -rf build dist .mypy_cache .pytest_cache .ruff_cache src/*.egg-info __pycache__
rm -rf .mypy_cache .pytest_cache .ruff_cache build dist htmlcov .coverage

install-dev:
python3 -m pip install --upgrade pip
pip install --no-cache-dir -e ".[dev,scrapy]"
pre-commit install
python3 -m pip install --upgrade pip poetry
poetry install --all-extras
poetry run pre-commit install

build:
python3 -m build
poetry build --no-interaction -vv

publish:
python3 -m twine upload dist/*

twine-check:
python3 -m twine check dist/*
# 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

lint:
python3 -m ruff check $(DIRS_WITH_CODE)
poetry run ruff format --check $(DIRS_WITH_CODE)
poetry run ruff check $(DIRS_WITH_CODE)

type-check:
poetry run mypy $(DIRS_WITH_CODE)

unit-tests:
python3 -m pytest --numprocesses=auto --verbose -ra --cov=src/apify tests/unit
poetry run pytest --numprocesses=auto --verbose --cov=src/apify tests/unit

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

integration-tests:
python3 -m pytest --numprocesses=$(INTEGRATION_TESTS_CONCURRENCY) --verbose -ra tests/integration
poetry run pytest --numprocesses=$(INTEGRATION_TESTS_CONCURRENCY) tests/integration

type-check:
python3 -m mypy $(DIRS_WITH_CODE)
format:
poetry run ruff check --fix $(DIRS_WITH_CODE)
poetry run ruff format $(DIRS_WITH_CODE)

# 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

format:
python3 -m ruff check --fix $(DIRS_WITH_CODE)
python3 -m ruff format $(DIRS_WITH_CODE)

check-version-availability:
python3 scripts/check_version_availability.py
poetry run python scripts/check_version_availability.py

check-changelog-entry:
python3 scripts/check_version_in_changelog.py
poetry run python scripts/check_version_in_changelog.py

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

run-doc: build-api-reference
cd website && corepack enable && yarn && yarn start
Loading