Workspace-scoped Python dependency manager for ROS2
Project description
petal
Workspace-scoped Python dependency manager for ROS2.
Petal discovers Python dependencies in a ROS2 workspace, resolves apt-first, falls back to PyPI when needed, installs pip packages into .petal/venv, and writes petal.lock.
Petal is dependency management, not node isolation. ROS2 still runs in one shared Python interpreter view, so petal venvs are created with --system-site-packages.
Install
uv tool install petal-ros
If you use the colcon verb, install the colcon extra:
uv tool install "petal-ros[colcon]"
Local development:
git clone https://github.com/matthewyjiang/petal.git
cd petal
python3 -m pip install -e .
Requires Python 3.10+, ROS2 under /opt/ros/<distro>, rosdep, apt tools, and preferably uv.
Quickstart
From a ROS2 workspace root:
petal init
petal add numpy
petal sync
petal status
source .petal/activate
Examples
Apt-resolved package:
petal add numpy
PyPI package:
petal add huggingface
Rosdep-resolved ROS package:
petal add cv_bridge
Commands
petal init # create petal.toml and .petal/venv
petal add <name> [spec] # add dependency and sync it
petal remove <name> # remove dependency from manifest and venv
petal sync # resolve, install, write petal.lock
petal sync --yes # skip install prompt
petal sync --no # show plan, install nothing
petal sync --dry-run # show commands, install nothing
petal sync --frozen # enforce petal.lock
petal status # report drift; exits 2 on drift/missing/change
petal activate # print shell snippet for ROS + venv activation
petal clean # remove .petal/venv
petal sync and petal add print the resolved source for each dependency before installing. If petal add is declined, cancelled, or run with --dry-run, petal.toml stays unchanged.
Manifest
[workspace]
ros_distro = "humble"
python_version = "3.10"
[deps]
numpy = ">=1.24"
huggingface = ">=0.0.1"
some-system-lib = { apt = "libfoo-dev" }
[overrides]
ml_collections = { pip = "ml-collections" }
Resolution order: ROS/system modules, rosdep, apt (python3-<name>), then PyPI.
Development
uv run --with pytest pytest -q
Unit tests use fake subprocess runners and do not require network, real ROS, apt, rosdep, uv, or colcon.
Release
Publishing runs from GitHub Actions when a v* tag is pushed. PyPI should be configured for trusted publishing with project petal-ros, owner matthewyjiang, repository petal, workflow publish.yml, and environment pypi.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file petal_ros-0.1.0.tar.gz.
File metadata
- Download URL: petal_ros-0.1.0.tar.gz
- Upload date:
- Size: 34.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5a87cf15ba667b27c261090e37429cb561023f912c63693085a90abd21b686f
|
|
| MD5 |
f79414aa345e6027d882ec23ea969d96
|
|
| BLAKE2b-256 |
51f580b71fe329e5e2bcefbfaacd2cd3cba4a246fe3787eacd52040f631c1a05
|
Provenance
The following attestation bundles were made for petal_ros-0.1.0.tar.gz:
Publisher:
publish.yml on matthewyjiang/petal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
petal_ros-0.1.0.tar.gz -
Subject digest:
c5a87cf15ba667b27c261090e37429cb561023f912c63693085a90abd21b686f - Sigstore transparency entry: 1715583000
- Sigstore integration time:
-
Permalink:
matthewyjiang/petal@dbb6ea948185ecc1cc2f9c85ed947136f16a0cb9 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/matthewyjiang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dbb6ea948185ecc1cc2f9c85ed947136f16a0cb9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file petal_ros-0.1.0-py3-none-any.whl.
File metadata
- Download URL: petal_ros-0.1.0-py3-none-any.whl
- Upload date:
- Size: 25.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94223c50704f286b4edc6b208bedfbfea7d0c53a6ad1925d1aa0795fd708bec2
|
|
| MD5 |
2e7a929c0c2ae4a8233c3773da982066
|
|
| BLAKE2b-256 |
3a55453aeef8b15640e03e37261b5fc629c9ebf89da60c81795f0ed11e3ced41
|
Provenance
The following attestation bundles were made for petal_ros-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on matthewyjiang/petal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
petal_ros-0.1.0-py3-none-any.whl -
Subject digest:
94223c50704f286b4edc6b208bedfbfea7d0c53a6ad1925d1aa0795fd708bec2 - Sigstore transparency entry: 1715583089
- Sigstore integration time:
-
Permalink:
matthewyjiang/petal@dbb6ea948185ecc1cc2f9c85ed947136f16a0cb9 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/matthewyjiang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dbb6ea948185ecc1cc2f9c85ed947136f16a0cb9 -
Trigger Event:
push
-
Statement type: