-
Notifications
You must be signed in to change notification settings - Fork 216
Prefer $EBPYTHONPREFIXES over $PYTHONPATH
#4496
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
Changes from 1 commit
0ec2df5
74a3cb3
03e304e
b07ea3f
8c66e1a
ccd3d7e
f76f320
8b5389f
cb6adb0
4a11f2f
c471e03
2676e4e
f4fbe76
92f0e62
e91186e
236c67f
ca304fb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -213,25 +213,20 @@ def _filter_paths(self, key, paths): | |
| return paths | ||
|
|
||
| added_paths = self.added_paths_per_key.setdefault(key, set()) | ||
| # Coerce any iterable/generator into a list | ||
| if not isinstance(paths, list): | ||
| paths = list(paths) | ||
| filtered_paths = [x for x in paths if x not in added_paths and not added_paths.add(x)] | ||
| if filtered_paths != paths: | ||
| removed_paths = paths if filtered_paths is None else [x for x in paths if x not in filtered_paths] | ||
| print_warning("Suppressed adding the following path(s) to $%s of the module as they were already added: %s", | ||
Micket marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| key, ', '.join(removed_paths), | ||
| log=self.log) | ||
| if not filtered_paths: | ||
| filtered_paths = None | ||
| return filtered_paths | ||
|
|
||
| def append_paths(self, key, paths, allow_abs=False, expand_relpaths=True): | ||
| """ | ||
| Generate append-path statements for the given list of paths. | ||
|
|
||
| :param key: environment variable to append paths to | ||
| :param paths: list of paths to append | ||
| :param paths: single or list of paths to append | ||
| :param allow_abs: allow providing of absolute paths | ||
| :param expand_relpaths: expand relative paths into absolute paths (by prefixing install dir) | ||
| """ | ||
|
|
@@ -242,7 +237,7 @@ def prepend_paths(self, key, paths, allow_abs=False, expand_relpaths=True): | |
| Generate prepend-path statements for the given list of paths. | ||
|
|
||
| :param key: environment variable to append paths to | ||
| :param paths: list of paths to append | ||
| :param paths: single or list of paths to append | ||
| :param allow_abs: allow providing of absolute paths | ||
| :param expand_relpaths: expand relative paths into absolute paths (by prefixing install dir) | ||
| """ | ||
|
|
@@ -253,13 +248,15 @@ def update_paths(self, key, paths, prepend=True, allow_abs=False, expand_relpath | |
| Generate append/prepend-path statements for the given list of paths. | ||
|
|
||
| :param key: environment variable to append paths to | ||
| :param paths: list of paths to append | ||
| :param paths: single or list of paths to append | ||
| :param allow_abs: allow providing of absolute paths | ||
| :param expand_relpaths: expand relative paths into absolute paths (by prefixing install dir) | ||
| """ | ||
| if isinstance(paths, str): | ||
| self.log.debug("Wrapping %s into a list before using it for %s", paths, key) | ||
| paths = [paths] | ||
| elif not isinstance(paths, list): | ||
| paths = list(paths) # coerce any iterator into a list | ||
|
|
||
| if key == 'PYTHONPATH': | ||
| python_paths = [path for path in paths if re.match(r'lib/python\d+\.\d+/site-packages', path)] | ||
|
||
|
|
@@ -976,14 +973,12 @@ def _update_paths(self, key, paths, prepend=True, allow_abs=False, expand_relpat | |
| Generate prepend-path or append-path statements for the given list of paths. | ||
|
|
||
| :param key: environment variable to prepend/append paths to | ||
| :param paths: list of paths to prepend | ||
| :param paths: list of paths to prepend/append | ||
Micket marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| :param prepend: whether to prepend (True) or append (False) paths | ||
| :param allow_abs: allow providing of absolute paths | ||
| :param expand_relpaths: expand relative paths into absolute paths (by prefixing install dir) | ||
| """ | ||
| paths = self._filter_paths(key, paths) | ||
| if paths is None: | ||
| return '' | ||
|
|
||
| if prepend: | ||
| update_type = 'prepend' | ||
|
|
@@ -1453,8 +1448,6 @@ def _update_paths(self, key, paths, prepend=True, allow_abs=False, expand_relpat | |
| :param expand_relpaths: expand relative paths into absolute paths (by prefixing install dir) | ||
| """ | ||
| paths = self._filter_paths(key, paths) | ||
| if paths is None: | ||
| return '' | ||
|
|
||
| if prepend: | ||
| update_type = 'prepend' | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.