Skip to content

Commit e29f3ce

Browse files
vdusekclaude
andauthored
ci: Improve shared python workflows (#587)
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 <[email protected]>
1 parent 831f91a commit e29f3ce

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: "1"

pyproject.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,10 @@ known-local-folder = ["apify_client"]
154154
max-branches = 18
155155

156156
[tool.pytest.ini_options]
157-
addopts = "-ra"
157+
addopts = "-r a --verbose"
158158
asyncio_default_fixture_loop_scope = "function"
159159
asyncio_mode = "auto"
160-
timeout = 1200
160+
timeout = 1800
161161

162162
[tool.ty.environment]
163163
python-version = "3.10"
@@ -184,13 +184,13 @@ context = 7
184184
[tool.poe.tasks]
185185
clean = "rm -rf .coverage .pytest_cache .ruff_cache .ty_cache build dist htmlcov"
186186
install-sync = "uv sync --all-extras"
187-
build = "uv build --verbose"
188-
publish-to-pypi = "uv publish --verbose --token ${APIFY_PYPI_TOKEN_CRAWLEE}"
187+
build = "uv build"
188+
publish-to-pypi = "uv publish --token ${APIFY_PYPI_TOKEN_CRAWLEE}"
189189
type-check = "uv run ty check"
190-
unit-tests = "uv run pytest --numprocesses=auto --verbose tests/unit"
191-
unit-tests-cov = "uv run pytest --numprocesses=auto --verbose --cov=src/apify_client --cov-report=xml:coverage-unit.xml tests/unit"
192-
integration-tests = "uv run pytest --numprocesses=${INTEGRATION_TESTS_CONCURRENCY:-1} --verbose tests/integration"
193-
integration-tests-cov = "uv run pytest --numprocesses=${INTEGRATION_TESTS_CONCURRENCY:-1} --verbose --cov=src/apify_client --cov-report=xml:coverage-integration.xml tests/integration"
190+
unit-tests = "uv run pytest --numprocesses=${TESTS_CONCURRENCY:-auto} tests/unit"
191+
unit-tests-cov = "uv run pytest --numprocesses=${TESTS_CONCURRENCY:-auto} --cov=src/apify_client --cov-report=xml:coverage-unit.xml tests/unit"
192+
integration-tests = "uv run pytest --numprocesses=${TESTS_CONCURRENCY:-auto} tests/integration"
193+
integration-tests-cov = "uv run pytest --numprocesses=${TESTS_CONCURRENCY:-auto} --cov=src/apify_client --cov-report=xml:coverage-integration.xml tests/integration"
194194
check-async-docstrings = "uv run python scripts/check_async_docstrings.py"
195195
fix-async-docstrings = "uv run python scripts/fix_async_docstrings.py"
196196
check-code = ["lint", "type-check", "unit-tests", "check-async-docstrings"]

0 commit comments

Comments
 (0)