Skip to content

Commit 3727e62

Browse files
Avoid deb_system and --install-layout deb (#507)
* Avoid deb_system and --install-layout deb Signed-off-by: Shane Loretz <[email protected]> * Fix comment Signed-off-by: Shane Loretz <[email protected]> * Add hardcodes to words Signed-off-by: Shane Loretz <[email protected]> * The latter -> which Signed-off-by: Shane Loretz <[email protected]> Co-authored-by: Steven! Ragnarök <[email protected]> * Add install-layout code back to non-symlink install Signed-off-by: Shane Loretz <[email protected]> Co-authored-by: Steven! Ragnarök <[email protected]>
1 parent 995203e commit 3727e62

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

colcon_core/python_install_path.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ def get_python_install_path(name, vars_=()):
1818
"""
1919
kwargs = {}
2020
kwargs['vars'] = dict(vars_)
21+
# Avoid deb_system because it means using --install-layout deb
22+
# which ignores --prefix and hardcodes it to /usr
2123
if 'deb_system' in sysconfig.get_scheme_names():
22-
kwargs['scheme'] = 'deb_system'
24+
kwargs['scheme'] = 'posix_prefix'
2325

2426
return Path(sysconfig.get_path(name, **kwargs))

colcon_core/task/python/build.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ async def build(self, *, additional_hooks=None): # noqa: D102
110110
]
111111
if setup_py_data.get('data_files'):
112112
cmd += ['install_data', '--install-dir', args.install_base]
113-
self._append_install_layout(args, cmd)
114113
completed = await run(
115114
self.context, cmd, cwd=args.build_base, env=env)
116115
finally:
@@ -300,5 +299,9 @@ def _get_python_lib(self, args):
300299
return os.path.relpath(path, start=args.install_base)
301300

302301
def _append_install_layout(self, args, cmd):
302+
# Debian patches sysconfig to return a path containing dist-packages
303+
# instead of site-packages when using the default install scheme.
304+
# TODO(sloretz) this is potentially unused now that
305+
# get_python_install_path avoids the deb_system scheme.
303306
if 'dist-packages' in self._get_python_lib(args):
304307
cmd += ['--install-layout', 'deb']

test/spell_check.words

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ getcategory
4141
getpid
4242
getpreferredencoding
4343
github
44+
hardcodes
4445
hookimpl
4546
hookwrapper
4647
https
@@ -100,6 +101,7 @@ setupscript
100101
setuptools
101102
shlex
102103
sigint
104+
sloretz
103105
stacklevel
104106
staticmethod
105107
stdeb

0 commit comments

Comments
 (0)