colcon-uv
A colcon extension for building and testing Python packages that use uv for dependency management.
Features
- Fast Dependency Management: Leverages UV's lightning-fast dependency resolution and installation
- Modern Python Packaging: Support for
pyproject.toml-based packages following PEP 517/518 standards - ROS Integration: Seamless integration with colcon build system and ROS package management
- Dependency Isolation: Prevents dependency conflicts between packages
Configuration
Data Files
Similar to colcon-poetry-ros, you can specify data files using the [tool.colcon-uv-ros.data-files] section:
[tool.colcon-uv-ros.data-files]
"share/ament_index/resource_index/packages" = ["resource/{package_name}"]
"share/{package_name}" = ["package.xml", "launch/", "config/"]
"lib/{package_name}" = ["scripts/"]
Required entries for all ROS packages:
[tool.colcon-uv-ros.data-files]
"share/ament_index/resource_index/packages" = ["resource/{package_name}"]
"share/{package_name}" = ["package.xml"]
Package Dependencies
Specify package dependencies for build ordering and to use system libraries (fetched from system paths, not installed in virtual environment):
[tool.colcon-uv-ros.dependencies]
depend = ["rclpy", "geometry_msgs"] # System packages (adds to both build_depend and exec_depend)
build_depend = ["bar_package"] # Build-time only dependency
exec_depend = ["std_msgs"] # Runtime system library
test_depend = ["qux_package"] # Test-time only dependency
Important: ROS system libraries like rclpy, geometry_msgs, std_msgs, etc. should be listed here so they are resolved from the system installation rather than being installed into the virtual environment.
Package Source Configuration
Control where uv pip install fetches packages from. This is essential for platforms with custom-built wheels (e.g., NVIDIA Jetson with CUDA-specific torch builds) or private package indexes.
[tool.colcon-uv-ros]
name = "my_package"
# Override the default PyPI index (single string)
# index-url = "https://custom.pypi.org/simple"
# Additional package indexes (list)
extra-index-url = ["https://my-private.pypi.org/simple"]
# Local wheel directories or URLs (list)
find-links = ["/opt/jetson-wheels"]
When pyproject.toml keys are absent, the following environment variables are used as fallback:
COLCON_UV_INDEX_URL— overrides default indexCOLCON_UV_EXTRA_INDEX_URL— comma-separated list of extra indexesCOLCON_UV_FIND_LINKS— comma-separated list of find-links paths
Precedence: pyproject.toml > environment variables > uv defaults.
Jetson / Custom Platform Example
On platforms like NVIDIA Jetson, PyPI wheels for packages like torch are CPU-only. The Jetson needs GPU-specific builds. Combine extra-site-packages (to pre-seed existing builds) with find-links (for local wheel directories):
[tool.colcon-uv-ros]
name = "my_perception_package"
# Pre-seed the venv with packages from this path so uv skips them.
# Their dist-info is copied into the venv, and a .pth file makes
# Python resolve the actual modules at runtime.
extra-site-packages = ["/opt/venv/lib/python3.12/site-packages"]
# Local Jetson-built wheels for deps not pre-seeded above
find-links = ["/opt/jetson-wheels"]
Pin versions in [project.dependencies] to match your pre-seeded builds so uv doesn't resolve a different version from PyPI:
[project]
dependencies = [
"torch==2.7.0",
"torchvision==0.22.0",
"ultralytics",
]
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 colcon_uv-0.4.1.tar.gz.
File metadata
- Download URL: colcon_uv-0.4.1.tar.gz
- Upload date:
- Size: 18.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a66c55b6b24740d917d9cbbd1c61c07758a0ddacadb41d4e350e61647f3374c
|
|
| MD5 |
725cfbda535a2d193eee101a8192d248
|
|
| BLAKE2b-256 |
eeb626a4a2cb7603f4e952ec6c6bfc881e6b44251153b7b918f6e91ba10b9bc0
|
Provenance
The following attestation bundles were made for colcon_uv-0.4.1.tar.gz:
Publisher:
publish.yml on nzlz/colcon-uv
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
colcon_uv-0.4.1.tar.gz -
Subject digest:
2a66c55b6b24740d917d9cbbd1c61c07758a0ddacadb41d4e350e61647f3374c - Sigstore transparency entry: 2511155958
- Sigstore integration time:
-
Permalink:
nzlz/colcon-uv@c9010c9143a82b9547ba5aded8372e15c38d883c -
Branch / Tag:
refs/tags/v0.4.1 - Owner: https://github.com/nzlz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c9010c9143a82b9547ba5aded8372e15c38d883c -
Trigger Event:
push
-
Statement type:
File details
Details for the file colcon_uv-0.4.1-py2.py3-none-any.whl.
File metadata
- Download URL: colcon_uv-0.4.1-py2.py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d43896eaaf7e14df3d6113e159d8b97a4ba37206e4e5c7d782cfc6c1995b4126
|
|
| MD5 |
ff69ba4fbbb8d4a05589c9d26573b5ea
|
|
| BLAKE2b-256 |
51fa86ecb77647295221bbd5343a7b7b18ae7f05813b791707cbf0c6d2f42bea
|
Provenance
The following attestation bundles were made for colcon_uv-0.4.1-py2.py3-none-any.whl:
Publisher:
publish.yml on nzlz/colcon-uv
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
colcon_uv-0.4.1-py2.py3-none-any.whl -
Subject digest:
d43896eaaf7e14df3d6113e159d8b97a4ba37206e4e5c7d782cfc6c1995b4126 - Sigstore transparency entry: 2511155968
- Sigstore integration time:
-
Permalink:
nzlz/colcon-uv@c9010c9143a82b9547ba5aded8372e15c38d883c -
Branch / Tag:
refs/tags/v0.4.1 - Owner: https://github.com/nzlz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c9010c9143a82b9547ba5aded8372e15c38d883c -
Trigger Event:
push
-
Statement type: