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.0.tar.gz (17.9 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.0-py2.py3-none-any.whl (16.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file colcon_uv-0.4.0.tar.gz.

File metadata

  • Download URL: colcon_uv-0.4.0.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for colcon_uv-0.4.0.tar.gz
Algorithm Hash digest
SHA256 15e5fb246976408b1c6593bb551a65668cac191a6a0b494ab7305417caedb99e
MD5 f75737ef88dbfb2688367beed1149ec2
BLAKE2b-256 1672bb26763cd17f2b85625e531eea411e8f97ee12d20243ab1ca3cedcef7405

See more details on using hashes here.

Provenance

The following attestation bundles were made for colcon_uv-0.4.0.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.0-py2.py3-none-any.whl.

File metadata

  • Download URL: colcon_uv-0.4.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for colcon_uv-0.4.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 cb248640639cba01f1e6e77109a6b1a52db0a95791c8a60a81e735f9d33f11af
MD5 302e9d1e6ebab282b0a2f03050b248dc
BLAKE2b-256 e8006dee5f7bb1d550b8d40a11f07f343d7a8896b96a74a2f6faf657eeea7087

See more details on using hashes here.

Provenance

The following attestation bundles were made for colcon_uv-0.4.0-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

0.4.1

2 files

This release

0.4.0 This release

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