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

Move sitecustomize.py into site-packages #3514

Open
wants to merge 3 commits into
base: 5.0.x
Choose a base branch
from

Conversation

Micket
Copy link
Contributor

@Micket Micket commented Nov 22, 2024

fixes #3493

@Micket Micket added the change label Nov 22, 2024
@Micket Micket added this to the 5.0 milestone Nov 22, 2024
if self.cfg.get('ebpythonprefixes'):
txt += self.module_generator.prepend_paths(PYTHONPATH, self.pythonpath)
new_dir = os.path.join('lib', 'python' + self.pyshortver, 'site-packages')
old_dir = os.path.join(log_path(), 'python')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log_path isn't actually the correct path, see #3400
Maybe we can either use easybuild directly (if I remember that path correctly) or at least add a comment why log_path is abused here

txt += self.module_generator.prepend_paths(PYTHONPATH, self.pythonpath)
new_dir = os.path.join('lib', 'python' + self.pyshortver, 'site-packages')
old_dir = os.path.join(log_path(), 'python')
if not os.path.exists(os.path.join(self.installdir, new_dir, 'sitecustomize.py')):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we maybe use a "constant" for this path similar to self.pythonpath to avoid repeating it in 2 locations that are quite a bit apart? I'd also check if the script exists in old_dir (or at least that folder) before adding the old path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Changed default
Development

Successfully merging this pull request may close these issues.

2 participants