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 all 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
# which ignores --prefix and hardcodes it to /usr
if 'deb_system' in sysconfig.get_scheme_names():
kwargs['scheme'] = 'deb_system'
kwargs['scheme'] = 'posix_prefix'

return Path(sysconfig.get_path(name, **kwargs))
5 changes: 4 additions & 1 deletion colcon_core/task/python/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,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 @@ -300,5 +299,9 @@ def _get_python_lib(self, args):
return os.path.relpath(path, start=args.install_base)

def _append_install_layout(self, args, cmd):
# Debian patches sysconfig to return a path containing dist-packages
# instead of site-packages when using the default install scheme.
# TODO(sloretz) this is potentially unused now that
# get_python_install_path avoids the deb_system scheme.
if 'dist-packages' in self._get_python_lib(args):
cmd += ['--install-layout', 'deb']
2 changes: 2 additions & 0 deletions test/spell_check.words
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ getcategory
getpid
getpreferredencoding
github
hardcodes
hookimpl
hookwrapper
https
Expand Down Expand Up @@ -100,6 +101,7 @@ setupscript
setuptools
shlex
sigint
sloretz
stacklevel
staticmethod
stdeb
Expand Down