Skip to content

Commit a48bd00

Browse files
vdusekclaude
andauthored
ci: Improve shared python workflows (#749)
Workflow improvements: - Update shared workflow input names to snake_case - Add tests_concurrency input for controlling parallel test execution - Use @improve-shared-python-workflows branch for testing Pytest configuration: - Standardize addopts to "-r a --verbose" - Set timeout to 1800 seconds - Use TESTS_CONCURRENCY env var in poe tasks (default: auto) --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 671e323 commit a48bd00

File tree

3 files changed

+20
-18
lines changed

3 files changed

+20
-18
lines changed

.github/workflows/_check_code.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ jobs:
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/_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"

pyproject.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,10 @@ known-first-party = ["apify_client", "apify_shared", "crawlee"]
192192
max-branches = 18
193193

194194
[tool.pytest.ini_options]
195-
addopts = "-ra"
195+
addopts = "-r a --verbose"
196196
asyncio_default_fixture_loop_scope = "function"
197197
asyncio_mode = "auto"
198-
timeout = 1200
198+
timeout = 1800
199199

200200
[tool.ty.environment]
201201
python-version = "3.10"
@@ -222,13 +222,13 @@ context = 7
222222
[tool.poe.tasks]
223223
clean = "rm -rf .coverage .pytest_cache .ruff_cache .ty_cache build dist htmlcov"
224224
install-sync = "uv sync --all-extras"
225-
build = "uv build --verbose"
226-
publish-to-pypi = "uv publish --verbose --token ${APIFY_PYPI_TOKEN_CRAWLEE}"
225+
build = "uv build"
226+
publish-to-pypi = "uv publish --token ${APIFY_PYPI_TOKEN_CRAWLEE}"
227227
type-check = "uv run ty check"
228-
unit-tests = "uv run pytest --numprocesses=auto --verbose tests/unit"
229-
unit-tests-cov = "uv run pytest --numprocesses=auto --verbose --cov=src/apify --cov-report=xml:coverage-unit.xml tests/unit"
230-
integration-tests = "uv run pytest --numprocesses=${INTEGRATION_TESTS_CONCURRENCY:-1} --verbose tests/integration"
231-
integration-tests-cov = "uv run pytest --numprocesses=${INTEGRATION_TESTS_CONCURRENCY:-1} --verbose --cov=src/apify --cov-report=xml:coverage-integration.xml tests/integration"
228+
unit-tests = "uv run pytest --numprocesses=${TESTS_CONCURRENCY:-auto} tests/unit"
229+
unit-tests-cov = "uv run pytest --numprocesses=${TESTS_CONCURRENCY:-auto} --cov=src/apify --cov-report=xml:coverage-unit.xml tests/unit"
230+
integration-tests = "uv run pytest --numprocesses=${TESTS_CONCURRENCY:-auto} tests/integration"
231+
integration-tests-cov = "uv run pytest --numprocesses=${TESTS_CONCURRENCY:-auto} --cov=src/apify --cov-report=xml:coverage-integration.xml tests/integration"
232232
check-code = ["lint", "type-check", "unit-tests"]
233233

234234
[tool.poe.tasks.install-dev]

0 commit comments

Comments
 (0)