feat: Add python-uv template#800
Draft
vdusek wants to merge 1 commit into
Draft
Conversation
Add a Python Actor template managed by the uv package manager - pyproject.toml with a committed uv.lock, a uv-based Dockerfile, and the same single-page scraper functionality as python-start for easy comparison. The template tests now dispatch on uv.lock and install dependencies with uv for uv-based templates.
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a
python-uvActor template - an example of building and running Actors with the uv package and project manager:pyproject.toml+ committeduv.lockand.python-version, so local development and the platform Docker build use identical dependency versions,uv sync --locked --no-devin a cached dependency layer),python-start(HTTPX + BeautifulSoup), so the two templates are directly comparable - only the project management differs,.gitignore/.dockerignore(keepuv.lockand.python-versioncommitted, never ship.venv).Infrastructure changes:
test/templates.test.js:checkPythonTemplatenow dispatches on the presence ofuv.lock- uv-based templates install dependencies viauv sync --upgrade(mirroring the requirements.txt flow, which also always installs the latest allowed versions) and the latest-SDK assertion stays in place. The pip flow is unchanged.test_python_templates.yaml: addedastral-sh/setup-uv(without a Python version input, so the template's.python-versionstays authoritative).Verified locally: the jest template test passes for
python-uv(structure, uv install + latest-SDK check,apify runscrapes and exits 0),python-emptypasses as a pip-flow control, and the Docker image builds and runs end to end. The dist archive is intentionally not included - the master automation builds and commits it after merge.Known limitation:
apify createcurrently hard-codespip install -r requirements.txtfor Python templates, so creating this template via the CLI errors after extraction (the project folder survives anduv sync+apify runwork fine -apify runalready picks up the uv-created.venv). The manifest'spostCreatemessage points users atuv sync, and--skip-dependency-installavoids the error entirely. A follow-up in apify/apify-cli (runuv syncwhenuv.lockis present) would close this gap.Companion documentation PR: apify/apify-sdk-python#932 (new "Use uv" SDK guide linking this template).
🤖 Generated with Claude Code