diff --git a/colcon_core/task/python/build.py b/colcon_core/task/python/build.py index 442d5a62..a72c1a54 100644 --- a/colcon_core/task/python/build.py +++ b/colcon_core/task/python/build.py @@ -77,9 +77,12 @@ async def build(self, *, additional_hooks=None): # noqa: D102 python_lib = os.path.join( args.install_base, self._get_python_lib(args)) os.makedirs(python_lib, exist_ok=True) + distutils_commands = os.path.join( + os.path.dirname(__file__), 'colcon_distutils_commands') # and being in the PYTHONPATH env = dict(env) env['PYTHONPATH'] = str(prefix_override) + os.pathsep + \ + distutils_commands + os.pathsep + \ python_lib + os.pathsep + env.get('PYTHONPATH', '') # coverage capture interferes with sitecustomize # See also: https://docs.python.org/3/library/site.html#module-site diff --git a/colcon_core/task/python/colcon_distutils_commands/__init__.py b/colcon_core/task/python/colcon_distutils_commands/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/colcon_core/task/python/colcon_distutils_commands/colcon_distutils_commands-0.0.0.dist-info/METADATA b/colcon_core/task/python/colcon_distutils_commands/colcon_distutils_commands-0.0.0.dist-info/METADATA new file mode 100644 index 00000000..c97b22f5 --- /dev/null +++ b/colcon_core/task/python/colcon_distutils_commands/colcon_distutils_commands-0.0.0.dist-info/METADATA @@ -0,0 +1,3 @@ +Metadata-Version: 2.1 +Name: colcon_distutils_commands +Version: 0.0.0 diff --git a/colcon_core/task/python/colcon_distutils_commands/colcon_distutils_commands-0.0.0.dist-info/entry_points.txt b/colcon_core/task/python/colcon_distutils_commands/colcon_distutils_commands-0.0.0.dist-info/entry_points.txt new file mode 100644 index 00000000..cade4c27 --- /dev/null +++ b/colcon_core/task/python/colcon_distutils_commands/colcon_distutils_commands-0.0.0.dist-info/entry_points.txt @@ -0,0 +1,2 @@ +[distutils.commands] +symlink_data = colcon_core.distutils.commands.symlink_data:symlink_data diff --git a/setup.cfg b/setup.cfg index 85391702..3928d02e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -145,14 +145,15 @@ colcon_core.verb = test = colcon_core.verb.test:TestVerb console_scripts = colcon = colcon_core.command:main -distutils.commands = - symlink_data = colcon_core.distutils.commands.symlink_data:symlink_data pytest11 = colcon_core_warnings_stderr = colcon_core.pytest.hooks [options.package_data] colcon_core.shell.template = *.em colcon_core.task.python.template = *.em +colcon_core.task.python.colcon_distutils_commands = + */METADATA + */entry_points.txt [flake8] import-order-style = google