A colcon extension for building and testing Python packages that use uv for dependency management.
Intended, but not limited, to use with ROS 2. This extension provides a modern alternative to traditional setuptools-based or even poetry-based Python package management in ROS environments.
⚠️ Experimental: This project is in early development. Testing, feedback, and contributions are welcome!
- 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
Important: This extension must be installed in the same environment as colcon to be discoverable by colcon's plugin system. Typically this means system-wide installation.
# Using pip
pip install colcon-uv --break-system-packages
# Using uv
uv pip install --system --break-system-packages colcon-uv# Using pip
pip install git+https://github.com/nzlz/colcon-uv.git#subdirectory=colcon_uv --break-system-packages
# Using uv
uv pip install --system --break-system-packages git+https://github.com/nzlz/colcon-uv.git#subdirectory=colcon_uvFor practical examples, see the test examples in this repository:
ament_cmakefor C++/Python hybrid packagestests/examples/uv_ament_cmake_exampleament_pythonfor pure Python packagestests/examples/uv_ament_python_example
When you run colcon build, dependencies are automatically installed using UV. No additional steps required!
# Dependencies are automatically installed during build
colcon build --packages-select my_packageSimilar to rosdep install, you can optionally install dependencies standalone before building:
# Install dependencies for all packages in src/
colcon uv installNote: This step is optional since colcon build automatically handles dependency installation. Use this when you want to pre-install dependencies or troubleshoot dependency issues separately from the build process.
Refer to colcon_uv/README.md
This project is inspired by and builds upon:
- colcon-poetry-ros - Poetry integration for ROS packages
- colcon-ros - Experimental ROS support for colcon
- uv - An extremely fast Python package installer and resolver
Built with the assistance of Cursor - AI-powered code editor.