Skip to main content

Extension for Colcon to get packages given a set of files.

Project description

# colcon-package-of

Given a set of files, output a list of packages which contain those files.

`text $ colcon package-of src/pkgX/foo.txt src/pkgY/bar.txt pkgX src/pkgX (python) pkgY src/pkgY (python) `

The –names-only and –paths-only options can be used to adjust the output.

For convince, there is also a –git-diff option, which is basically equivalent to using git diff with xargs. If there are added, deleted, modified, or untracked files corresponding to a package, that package will be listed:

` text $ touch src/pkgA/newfoo.txt $ rm src/pkgB/oldbar.txt $ colcon package-of --git-diff HEAD pkgA src/pkgA (python) pkgB src/pkgB (python) `

## Example Usage

Let’s say you have a list of modified files, and you want to incrementally build only the packages corresponding to those files. You can do this:

`text MY_PKGS=$(colcon package-of -n $MY_FILES) [ -z "$MY_PKGS" ] || colcon build --packages-above $MY_PKGS `

You may be able to take advantage of the –git-diff option in CI, to build only the packages that have changed since the last commit:

` text DIFF_PKGS=$(colcon package-of -n --git-diff HEAD^) [ -z "$DIFF_PKGS" ] || colcon build --packages-above $DIFF_PKGS `

## Minimum Python Version

Unlike colcon-core which supports Python 3.6, colcon-package-of requires Python 3.10 due to use of Path.is_relative_to, etc.

## OS Support

This package is tested on Linux (Ubuntu 22.04) and MacOS. It is not tested on Windows (yet).

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

colcon_package_of-0.1.0.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

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

colcon_package_of-0.1.0-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file colcon_package_of-0.1.0.tar.gz.

File metadata

  • Download URL: colcon_package_of-0.1.0.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for colcon_package_of-0.1.0.tar.gz
Algorithm Hash digest
SHA256 387096042368e20e0aefce76ea918ffa002740703210bf96e3810eba322b8eb0
MD5 4541b479cde2fbf9ab2bb09cd94b1418
BLAKE2b-256 c4d2516aefbec0fbb4ff52052a43f8a63ec033912a03f811ee37796b2ab351ab

See more details on using hashes here.

File details

Details for the file colcon_package_of-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for colcon_package_of-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e411bc7e3b82b2b6fa1af9fbd0ceaede4c944d855f89ae1e0e8fb48c31e5f46
MD5 17bc949e61561abf8b8fd2e0482b297d
BLAKE2b-256 6551b77318f23e106dab4f4a4571732bab6a6491ceb58405624f1e61bd355660

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page