@flowwright/plugin-python
The Python equivalent of plugin-node, across three package
managers. It is deliberately smaller — read the differences below before assuming
parity.
npm install --save-dev @flowwright/plugin-python
API
| Export | Kind | Signature |
|---|---|---|
pythonStages | stage builder | (options?) => StageDefinition[] |
pythonServicePipeline | pipeline | (options?: PythonPipelineOptions) => PipelineDefinition |
| Option | Default | Meaning |
|---|---|---|
packageManager | "pip" | pip, uv or poetry |
cache | true | Cache .venv — ignored for pip |
install | true | false skips it; a string replaces the command |
lint, test | true | ruff check . / pytest |
format, typecheck | false | ruff format --check . / mypy . |
build | false | Off by default, unlike node |
artifactPath | "dist" | Only meaningful when build is on |
publish | false | { credential }, default "pypi-token" |
name | "python-service" | pythonServicePipeline only |
Example
import { pipeline, group } from "@flowwright/core";
import { pythonStages } from "@flowwright/plugin-python";
export default pipeline({
name: "acme-svc",
concurrency: 3,
stages: [
...group(
"ci",
pythonStages({
packageManager: "uv",
typecheck: true,
build: true,
artifactPath: "dist",
}),
),
],
});
What it composes down to
Defaults with pip — note there is no build stage:
install
$ pip install -r requirements.txt
lint ← install
$ ruff check .
test ← install
$ pytest
With uv, tools are prefixed and the install caches .venv under
uv-deps-<hash of uv.lock>:
install
$ uv sync --frozen
lint ← install
$ uv run ruff check .
test ← install
$ uv run pytest
| Package manager | Install | Lockfile | Tool prefix |
|---|---|---|---|
pip | pip install -r requirements.txt | requirements.txt | none |
uv | uv sync --frozen | uv.lock | uv run |
poetry | poetry install | poetry.lock | poetry run |
Poetry stages also carry POETRY_VIRTUALENVS_IN_PROJECT=true, so the venv lands in
the project and is cacheable.
Publish binds the token to the variable each tool expects:
| Package manager | Command | Env |
|---|---|---|
pip | twine upload dist/* | TWINE_PASSWORD (+ TWINE_USERNAME=__token__) |
uv | uv publish | UV_PUBLISH_TOKEN |
poetry | poetry publish | POETRY_PYPI_TOKEN_PYPI |
Gotchas
build defaults to false — the opposite of plugin-node. A pipeline that looks
like it should produce a wheel produces nothing until you pass build: true.
pip never caches. There's no in-project venv to cache, so cache is narrowed away
for pip. Passing cache: true explicitly with pip throws, so the setting can't
silently do nothing; leaving it at the default is fine.
No container support and no version matrix. There is no pythonVersion or
pythonVersions — set container on the stages yourself if you need a pinned
interpreter, or build them with a .map(). See
Containers.
No audit stage, unlike node.
Some combinations throw: artifactPath without build, cache: true with
install: false, and name passed to pythonStages(). See
the overview.