Skip to content

feat: add python-package-check composite action#296

Closed
vdusek wants to merge 2 commits into
mainfrom
feat/python-package-check-action
Closed

feat: add python-package-check composite action#296
vdusek wants to merge 2 commits into
mainfrom
feat/python-package-check-action

Conversation

@vdusek
Copy link
Copy Markdown
Contributor

@vdusek vdusek commented May 13, 2026

Adds a composite action python-package-check that verifies the sdist + wheel in dist/ install and import cleanly into fresh venvs, and that archive contents are correct (metadata files present, full src/<pkg> tree shipped, no tests/ / docs/ / uv.lock leaks). Optional smoke_code runs extra assertions after import <pkg>.

To be used after prepare-pypi-distribution in PR checks and release flows across crawlee-python, apify-sdk-python, apify-client-python, apify-shared-python.

Also adds repo-wide ruff + ty config (pyproject.toml, uv.lock) and a python_checks CI job covering the two Python scripts now in this repo.

Verified locally against built artifacts of all four Python packages.

@vdusek vdusek added adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels May 13, 2026
@vdusek vdusek self-assigned this May 13, 2026
@github-actions github-actions Bot added this to the 140th sprint - Tooling team milestone May 13, 2026
@vdusek vdusek force-pushed the feat/python-package-check-action branch from 05b5028 to dfe6669 Compare May 14, 2026 08:11
@vdusek vdusek force-pushed the feat/python-package-check-action branch from ffe0fb0 to 9127410 Compare May 14, 2026 08:59
@vdusek vdusek requested a review from janbuchar May 14, 2026 09:00
Copy link
Copy Markdown
Contributor

@janbuchar janbuchar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly fine by me, but watch out for https://github.com/apify/actions/ - perhaps you should direct the PR there 🙂

Comment on lines +10 to +18
src_package_dir:
description: Path to the package source directory, relative to the repository root.
required: true
dist_dir:
description: Directory containing the built sdist + wheel.
required: true
python_version:
description: Python version to use for the verification venvs.
required: true
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't there a sensible default for these?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense, I'm just not sure about the Python version (it would be good to update this when adding support for a new Python version of that package, and it will be done package by package gradually). The other options make sense. I'll address it in apify/actions#11.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we always run this with uv run, you can specify typer and rich as script dependencies and make this shorter and more readable (no arcane argparse setup, no custom stdout formatting)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, good point, I'll address it in apify/actions#11.

@vdusek
Copy link
Copy Markdown
Contributor Author

vdusek commented May 18, 2026

closing in favor of apify/actions#11

@vdusek vdusek closed this May 18, 2026
vdusek added a commit to apify/apify-sdk-python that referenced this pull request May 18, 2026
## Summary

Adds an end-to-end check that the built sdist and wheel install cleanly,
ship the expected sources and data files, and that `import apify` works
— via the shared
[apify/workflows/python-package-check](apify/workflows#296)
action.

Wired into every PR via `_check_package.yaml`, and into both stable and
beta release workflows so the exact artifact about to hit PyPI is
verified first.

## Verified locally

Built `dist/` and ran the verification — all checks pass
(`apify==3.4.0`, sdist + wheel both install cleanly into a fresh Python
3.14 venv).
vdusek added a commit to apify/apify-client-python that referenced this pull request May 18, 2026
## Summary

Adds an end-to-end check that the built sdist and wheel install cleanly,
ship the expected sources and data files, and that `import apify_client`
works — via the shared
[apify/workflows/python-package-check](apify/workflows#296)
action.

Wired into every PR via `_check_package.yaml`, and into both stable and
beta release workflows so the exact artifact about to hit PyPI is
verified first.
vdusek added a commit to apify/apify-shared-python that referenced this pull request May 18, 2026
## Summary

Adds an end-to-end check that the built sdist and wheel install cleanly,
ship the expected sources and data files, and that `import apify_shared`
works — via the shared
[apify/workflows/python-package-check](apify/workflows#296)
action.

Wired into every PR via `_check_package.yaml`, and into both stable and
beta release workflows so the exact artifact about to hit PyPI is
verified first.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants