This repository contains plugins to integrate the following uv
commands into Pantsbuild lifecycle goals.
To run a plugin, run pants <name-of-goal>
.
To run the tests within this repo, from the project root, run pants uv-run-behave
.
Currently this is done by running pants uv-build
and pants uv-publish --uv-publish-url https://test.pypi.org/legacy/
within the CI build.
To install the published plugin, add the following to the project's pants.toml
file.
[GLOBAL]
backend_packages = ["pants_uv_lifecycle_plugin"]
plugins = ["pants-uv-lifecycle-plugin==<version>"]
uv-sync
: Runsuv sync
across all modules containing apyproject.toml
file within a Pants project.uv-build
: Runsuv build
across all modules containing apyproject.toml
file within a Pants project.uv-run-behave
: Runsuv run behave
across all modules containing"**/*.feature"
files within a**/tests/features"
directory within a Pants project. (Note: anytime you runuv run
, it will create the virtual environment if it doesn't already exist and update the module'suv.lock
file.)uv-publish
: Runsuv publish
for each module in a Pants project that contains apyproject.toml
, assuming the required build artifacts are already present in those directories. Can be run using the--uv-publish-url
,--uv-publish-token
, and--uv-publish-ignore-dirs
Pants Options. All options can be configured via command-line flags, environment variables, or config files. Reference the Pants Options documentation for more information on how to use Options.
To test the plugins within a sample project, run the following commands from the root project directory.
pants uv-run-behave # the example-project contains a set of simple unit tests