Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/test_python_templates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

# For uv-based templates (e.g. python-uv); uv provides its own Python from .python-version.
- name: Setup uv
uses: astral-sh/setup-uv@v8.3.2

- name: Install Chrome and Chromedriver
# Use pnpm dlx instead of npx — npx is the npm CLI and trips
# devEngines.packageManager=pnpm at the repo root.
Expand Down
19 changes: 19 additions & 0 deletions templates/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,25 @@
"showcaseFiles": ["my_actor/main.py", "my_actor/__main__.py"],
"useCases": ["STARTER", "WEB_SCRAPING"]
},
{
"id": "python-uv",
"name": "python-uv",
"label": "Python project managed by uv",
"category": "python",
"technologies": ["uv"],
"description": "A general-purpose Python Actor with its project and dependencies managed by the uv package manager. A minimal starting point for any use case.",
"messages": {
"postCreate": "To install the dependencies, run \"uv sync\" in the Actor directory. It creates a virtual environment in the \".venv\" folder and installs the locked dependencies from \"uv.lock\". To install additional Python packages, use \"uv add <package>\"."
},
"archiveUrl": "https://github.com/apify/actor-templates/blob/master/dist/templates/python-uv.zip?raw=true",
"defaultRunOptions": {
"build": "latest",
"memoryMbytes": 1024,
"timeoutSecs": 3600
},
"showcaseFiles": ["my_actor/main.py", "pyproject.toml", "my_actor/__main__.py"],
"useCases": ["STARTER"]
},
{
"id": "python-beautifulsoup",
"name": "python-beautifulsoup",
Expand Down
19 changes: 19 additions & 0 deletions templates/python-uv/.actor/actor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "https://apify.com/schemas/v1/actor.ide.json",
"actorSpecification": 1,
"name": "python-uv",
"title": "Python Actor managed by uv",
"description": "A Python Actor with its project and dependencies managed by uv.",
"version": "0.0",
"buildTag": "latest",
"meta": {
"templateId": "python-uv",
"generatedBy": "<FILL-IN-MODEL>"
},
"input": "./input_schema.json",
"output": "./output_schema.json",
"storages": {
"dataset": "./dataset_schema.json"
},
"dockerfile": "../Dockerfile"
}
34 changes: 34 additions & 0 deletions templates/python-uv/.actor/dataset_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"$schema": "https://apify.com/schemas/v1/dataset.ide.json",
"actorSpecification": 1,
"fields": {},
"views": {
"overview": {
"title": "Overview",
"transformation": {
"fields": ["greeting", "repeated", "python_version", "managed_by"]
},
"display": {
"component": "table",
"properties": {
"greeting": {
"label": "Greeting",
"format": "text"
},
"repeated": {
"label": "Repeated",
"format": "number"
},
"python_version": {
"label": "Python version",
"format": "text"
},
"managed_by": {
"label": "Managed by",
"format": "text"
}
}
}
}
}
}
25 changes: 25 additions & 0 deletions templates/python-uv/.actor/input_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"$schema": "https://apify.com/schemas/v1/input.ide.json",
"title": "Input schema for a uv-managed Apify Actor",
"type": "object",
"schemaVersion": 1,
"properties": {
"name": {
"title": "Name",
"type": "string",
"description": "The name the Actor greets in its output. Replace it with whatever input your Actor needs.",
"editor": "textfield",
"default": "world",
"prefill": "world"
},
"repeat": {
"title": "Repeat count",
"type": "integer",
"description": "How many times to log the greeting.",
"default": 3,
"minimum": 1,
"maximum": 10
}
},
"required": []
}
12 changes: 12 additions & 0 deletions templates/python-uv/.actor/output_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://apify.com/schemas/v1/output.ide.json",
"actorOutputSchemaVersion": 1,
"title": "Output schema",
"properties": {
"results": {
"type": "string",
"title": "Results",
"template": "{{links.apiDefaultDatasetUrl}}/items"
}
}
}
39 changes: 39 additions & 0 deletions templates/python-uv/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Git metadata - not needed inside the image
.git

# Apify storage folder
storage/

# Python virtual environment - recreated by `uv sync` during the Docker build
.venv/
.env/

# Python (and Python tools) cache files
__pycache__/
*.py[cod]
*$py.class
.mypy_cache/
.pytest_cache/
.ruff_cache/
.ty_cache/

# Python build files
__pypackages__/
build/
dist/
*.egg-info/
*.egg

# Environment variables
.env

# Log files
*.log

# Editor / OS noise
.idea/
.vscode
.zed
.DS_Store
.mise.toml
.nvim.lua
39 changes: 39 additions & 0 deletions templates/python-uv/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Apify storage folder
storage/

# Python virtual environment - recreated by `uv sync`
.venv/
.env/

# Python (and Python tools) cache files
__pycache__/
*.py[cod]
*$py.class
.mypy_cache/
.pytest_cache/
.ruff_cache/
.ty_cache/

# Python build files
__pypackages__/
build/
dist/
*.egg-info/
*.egg

# Environment variables
.env

# Log files
*.log

# Editor / OS noise
.idea/
.vscode
.zed
.DS_Store
.mise.toml
.nvim.lua

# Note: .python-version and uv.lock are intentionally committed - uv uses them
# to provide the same Python version and dependencies on every machine.
1 change: 1 addition & 0 deletions templates/python-uv/.python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.14
Loading
Loading