Skip to content

Symlink install of data_files for python setuptools packages #169

@stonier

Description

@stonier

This is especially useful for, e.g. ros2 launch files that need to reside in share/<package_name>. Currently, if you have

    ....
    data_files=[
        ('share/' + package_name, ['package.xml', 'my.launch.py']),
    ],
    ....

Then package.xml gets symlinked but the launch files do not:

package.bash
package.ps1
package.sh
my.launch.py
package.xml -> /my_workspace/src/my_package/package.xml
package.zsh

Symlink install handling is in colcon_core/task/python/__init__.py. @dirk-thomas mentioned that pulling the information from setup.py to unwind the install and replace with symlinks is difficult and potentially unreliable (depending on whatever other programmatic mischief is going on in setup.py) and a better place to define the information is in setup.cfg.

options.data_files is not supported in setuptools on bionic though (v39.0.1). Seems the version necessary may be v40.5.0 (setuptools issue 1522) and may have issues with dashes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions