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

patch reframe script to ensure Python packages are picked up from ReFrame installation directory in recent ReFrame easyconfigs #13844

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
5 changes: 4 additions & 1 deletion easybuild/easyconfigs/r/ReFrame/ReFrame-3.6.2.eb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ postinstallcmds = [
'mkdir -p %(installdir)s/share/man/man1 %(installdir)s/share/man/man8',
'cp docs/man/man1/reframe.1 %(installdir)s/share/man/man1',
'cp docs/man/man8/reframe.settings.8 %(installdir)s/share/man/man8',
'cp -r share/completions %(installdir)s/share/completions'
'cp -r share/completions %(installdir)s/share/completions',
# patch reframe script to disable import of 'site' module to make sure that Python packages installed
# in ReFrame installation directory are used, rather than those in the Python installation
r"sed -i 's@/\(python[0-9.]*\)$@/\1 -S@g' %(installdir)s/bin/reframe",
]

sanity_check_paths = {
Expand Down
5 changes: 4 additions & 1 deletion easybuild/easyconfigs/r/ReFrame/ReFrame-3.6.3.eb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ postinstallcmds = [
'mkdir -p %(installdir)s/share/man/man1 %(installdir)s/share/man/man8',
'cp docs/man/man1/reframe.1 %(installdir)s/share/man/man1',
'cp docs/man/man8/reframe.settings.8 %(installdir)s/share/man/man8',
'cp -r share/completions %(installdir)s/share/completions'
'cp -r share/completions %(installdir)s/share/completions',
# patch reframe script to disable import of 'site' module to make sure that Python packages installed
# in ReFrame installation directory are used, rather than those in the Python installation
r"sed -i 's@/\(python[0-9.]*\)$@/\1 -S@g' %(installdir)s/bin/reframe",
]

sanity_check_paths = {
Expand Down
3 changes: 3 additions & 0 deletions easybuild/easyconfigs/r/ReFrame/ReFrame-3.7.3.eb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ exts_list = [
postinstallcmds = [
"cp -r tutorials %(installdir)s",
"mkdir -p %(installdir)s/share && cp -r share/completions %(installdir)s/share/completions",
# patch reframe script to disable import of 'site' module to make sure that Python packages installed
# in ReFrame installation directory are used, rather than those in the Python installation
r"sed -i 's@/\(python[0-9.]*\)$@/\1 -S@g' %(installdir)s/bin/reframe",
Copy link
Member

Choose a reason for hiding this comment

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

I've checked and this change is causing the failure that I see. The Python being used is the one from my easybuild virtualenv.

diff on bin/reframe with and without this change.

< #!/rds/bear-apps/devel/eb-sjb-up/EL8/EL8-cas/venv-dev-develop-up/bin/python -S
---
> #!/rds/bear-apps/devel/eb-sjb-up/EL8/EL8-cas/venv-dev-develop-up/bin/python

Copy link
Member Author

Choose a reason for hiding this comment

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

So adding the -S led to zipfile not being found anymore, because it's installed in your virtualenv?

Copy link
Member

Choose a reason for hiding this comment

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

In the virtualenv

$ python -c "import zipfile; print(zipfile.__file__)"
/usr/lib64/python3.6/zipfile.py

Copy link
Contributor

Choose a reason for hiding this comment

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

Would in this case help if you start python with -S, prepend external to the sys.path as is being done now and then call site.main()?

]

sanity_check_paths = {
Expand Down