8000 GitHub - cloudflare/workers-py: Write Cloudflare Workers in 100% Python via Pyodide.
[go: up one dir, main page]

Skip to content

cloudflare/workers-py

workers-py

A set of libraries and tools for Python Workers.

Pywrangler

A CLI tool for managing vendored packages in a Python Workers project.

Installation

On Linux, you may be able to install the tool globally by running:

uv tool install workers-py

Alternatively, you can add workers-py to your pyproject.toml:

[dependency-groups]
dev = ["workers-py"]

Then run via uv run pywrangler.

Usage

uv run pywrangler --help
uv run pywrangler sync

Development

To run the CLI tool while developing it, use:

export REPO_ROOT=/path/to/repo
uv run --project $REPO_ROOT $REPO_ROOT/src/pywrangler --help

On Linux, to install it globally, you may also be able to run:

uv tool install -e .

Alternatively, you can add workers-py to your pyproject.toml:

[dependency-groups]
dev = ["workers-py"]

[tool.uv.sources]
workers-py = { path = "../workers-py" }

Then run via uv run pywrangler.

Lint

uv run ruff check --fix
uv run ruff format

Tests

$ uv cache clean
$ uv run pytest
$ uv run pytest tests/test_cli.py::test_sync_command_handles_missing_pyproject -v # Specific test

About

Write Cloudflare Workers in 100% Python via Pyodide.

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 6

Languages

0