Skip to content

feat: Add python-uv template - #800

Merged
vdusek merged 3 commits into
masterfrom
feat/python-uv-template
Aug 17, 2026
Merged

vdusek merged 3 commits into
masterfrom
feat/python-uv-template

Conversation

@vdusek

@vdusek vdusek commented Jun 3, 2026 •

Copy link
Copy Markdown
Contributor

Adds a python-uv Actor template - Actors built and run with uv.

Template

  • pyproject.toml + committed uv.lock and .python-version. Identical versions locally and in the platform build.
  • uv-based Dockerfile: uv from its official image, uv sync --locked --no-dev in a cached layer.
  • Same single-page scraper as python-start, so only the project management differs.
  • uv-aware .gitignore / .dockerignore: keep uv.lock, never ship .venv.

Infrastructure

  • test/templates.test.js: checkPythonTemplate dispatches on uv.lock. uv templates install via uv sync --upgrade. pip flow unchanged.
  • test_python_templates.yaml: added astral-sh/setup-uv, no Python input, so .python-version stays authoritative.

Verified

  • Jest template test passes for python-uv. python-empty passes as a pip control.
  • Docker image builds and runs end to end.

Related PRs

@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 Jun 3, 2026
@vdusek vdusek self-assigned this Jun 3, 2026
@github-actions github-actions Bot added this to the 142nd sprint - Tooling team milestone Jun 3, 2026
@github-actions github-actions Bot added the tested Temporary label used only programatically for some analytics. label Jun 3, 2026
@vdusek
vdusek marked this pull request as draft June 4, 2026 11:32
vdusek added a commit to apify/apify-sdk-python that referenced this pull request Jun 8, 2026
Adds a "Manage your project with uv" guide covering the whole Actor
lifecycle with the [uv](https://docs.astral.sh/uv/) package and project
manager: creating a project, the Actor scaffolding, running locally,
installing the locked dependencies in the Dockerfile, deploying, and
day-to-day dependency management.

- `docs/03_guides/10_uv.mdx` — the guide.
- `docs/03_guides/code/uv_project/` — the backing example project,
covered by the repo lint and type checks.
- Quick-start guides list updated.

The documented flow was verified end to end (local `apify run` + a real
Docker build/run). Since the Actor templates are pip-only for now, the
guide carries an info banner pointing to apify/actor-templates#350.
Companion template PR: apify/actor-templates#800.
@vdusek
vdusek force-pushed the feat/python-uv-template branch from 5f9af0d to 845fd1c Compare July 10, 2026 10:49
vdusek added a commit to apify/apify-cli that referenced this pull request Jul 26, 2026
`apify create` hard-coded `pip install -r requirements.txt` for Python
Actors, so creating a uv-managed template — which ships `pyproject.toml`
+ `uv.lock` and no `requirements.txt` — failed during dependency install
with `Could not open requirements file`.

`create` now detects uv-managed Python/Scrapy projects by the presence
of a committed `uv.lock` and installs their dependencies with `uv sync`
instead. The check runs before the system-Python detection, since uv
provides the interpreter pinned in `.python-version` itself, and falls
back to a warning with install instructions when the `uv` executable
isn't found.

This unblocks the upcoming `python-uv` template
(apify/actor-templates#800).
@vdusek
vdusek force-pushed the feat/python-uv-template branch from 2615dc0 to df91f79 Compare August 17, 2026 10:27
@vdusek
vdusek marked this pull request as ready for review August 17, 2026 10:27
@l2ysho
l2ysho requested a review from apify-factory August 17, 2026 11:37

@apify-factory apify-factory left a comment

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.

AI code review — python-uv template

Verdict: The PR delivers what it sets out to do. There is no linked issue; judged against its own description, the new python-uv template is well-built and mostly follows the established template conventions (layout, Dockerfile, apify>=4.0.0,<5.0.0 pin, base image, test wiring). I checked the Docker permission angle (root user → compileall and .venv writes succeed) and the SDK-version pin/test interaction — both are fine. No blocking correctness or security issues. The findings below are convention divergences worth a second look before merge; none are merge-blockers, and a human makes the final call.

# Location Issue Severity
1 .actor/actor.json:13-14 Uses input/output keys; the other 34 templates use inputSchema/outputSchema medium
2 test/templates.test.js:183 uv playwright branch installs all 3 browsers; pip path restricts to chromium low
3 .gitignore:6 / .dockerignore:9 .env/ directory entry looks unintended nit

Comment thread templates/python-uv/.actor/actor.json Resolved
Comment thread test/templates.test.js Resolved
Comment thread templates/python-uv/.gitignore Resolved

@l2ysho l2ysho left a comment

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.

thx @vdusek, pre- approved, pls check if @apify-factory review findings are valid

@vdusek
vdusek merged commit 91f8a10 into master Aug 17, 2026
58 checks passed
@vdusek
vdusek deleted the feat/python-uv-template branch August 17, 2026 12:24
@vdusek vdusek linked an issue Oct 27, 2026 that may be closed by this pull request
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. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python Actors: Add option for using uv setup

3 participants