Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid deb_system and --install-layout deb #507

Merged
merged 5 commits into from
May 3, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion colcon_core/python_install_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ def get_python_install_path(name, vars_=()):
"""
kwargs = {}
kwargs['vars'] = dict(vars_)
# Avoid deb_system because it means using --install-layout deb
# The latter ignores --prefix and hardcodes it to /usr
sloretz marked this conversation as resolved.
Show resolved Hide resolved
if 'deb_system' in sysconfig.get_scheme_names():
kwargs['scheme'] = 'deb_system'
kwargs['scheme'] = 'posix_prefix'

return Path(sysconfig.get_path(name, **kwargs))
6 changes: 0 additions & 6 deletions colcon_core/task/python/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ async def build(self, *, additional_hooks=None): # noqa: D102
if 'egg_info' in available_commands:
# prevent installation of dependencies specified in setup.py
cmd.append('--single-version-externally-managed')
self._append_install_layout(args, cmd)
completed = await run(
self.context, cmd, cwd=args.path, env=env)
if completed.returncode:
Expand All @@ -110,7 +109,6 @@ async def build(self, *, additional_hooks=None): # noqa: D102
]
if setup_py_data.get('data_files'):
cmd += ['install_data', '--install-dir', args.install_base]
self._append_install_layout(args, cmd)
completed = await run(
self.context, cmd, cwd=args.build_base, env=env)
finally:
Expand Down Expand Up @@ -298,7 +296,3 @@ def _symlinks_in_build(self, args, setup_py_data):
def _get_python_lib(self, args):
path = get_python_install_path('purelib', {'base': args.install_base})
return os.path.relpath(path, start=args.install_base)

def _append_install_layout(self, args, cmd):
if 'dist-packages' in self._get_python_lib(args):
cmd += ['--install-layout', 'deb']