Skip to main content

colcon-uv

CI

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 index
  • COLCON_UV_EXTRA_INDEX_URL — comma-separated list of extra indexes
  • COLCON_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

colcon_uv-0.4.1.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

colcon_uv-0.4.1-py2.py3-none-any.whl (16.8 kB view details)

Uploaded Python 2Python 3

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

Hashes for colcon_uv-0.4.1.tar.gz
Algorithm Hash digest
SHA256 2a66c55b6b24740d917d9cbbd1c61c07758a0ddacadb41d4e350e61647f3374c
MD5 725cfbda535a2d193eee101a8192d248
BLAKE2b-256 eeb626a4a2cb7603f4e952ec6c6bfc881e6b44251153b7b918f6e91ba10b9bc0

See more details on using hashes here.

Provenance

The following attestation bundles were made for colcon_uv-0.4.1.tar.gz:

Publisher: publish.yml on nzlz/colcon-uv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for colcon_uv-0.4.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d43896eaaf7e14df3d6113e159d8b97a4ba37206e4e5c7d782cfc6c1995b4126
MD5 ff69ba4fbbb8d4a05589c9d26573b5ea
BLAKE2b-256 51fa86ecb77647295221bbd5343a7b7b18ae7f05813b791707cbf0c6d2f42bea

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 files

0.4.0

2 files

0.2.0

2 files

0.1.0

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page