-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
62 lines (44 loc) · 1.88 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
.PHONY: clean install-dev build publish-to-pypi lint type-check unit-tests unit-tests-cov \
integration-tests format check-async-docstrings check-code fix-async-docstrings \
build-api-reference build-docs run-docs
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 .mypy_cache .pytest_cache .ruff_cache build dist htmlcov .coverage
install-dev:
poetry install --all-extras
poetry run pre-commit install
build:
poetry build --no-interaction -vv
# 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:
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:
poetry run pytest --numprocesses=auto --verbose --cov=src/apify_client tests/unit
unit-tests-cov:
poetry run pytest --numprocesses=auto --verbose --cov=src/apify_client --cov-report=html tests/unit
integration-tests:
poetry run pytest --numprocesses=$(INTEGRATION_TESTS_CONCURRENCY) tests/integration
format:
poetry run ruff check --fix $(DIRS_WITH_CODE)
poetry run ruff format $(DIRS_WITH_CODE)
check-async-docstrings:
poetry run python scripts/check_async_docstrings.py
# 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 check-async-docstrings
fix-async-docstrings:
poetry run python scripts/fix_async_docstrings.py
build-api-reference:
cd website && poetry run ./build_api_reference.sh
build-docs:
cd website && npm clean-install && npm run build
run-docs: build-api-reference
cd website && npm clean-install && npm run start