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

make sure user packages are not used in sanity check of PythonBundle #3435

Merged
merged 1 commit into from
Sep 7, 2024

Conversation

Flamefire
Copy link
Contributor

Some PythonBundle ECs (e.g. IPython) use custom sanity checks using python. That might pick up python packages installed to the users $HOME which can yield wrong results.
We already take care of this for the extensions sanity check in PythonPackage and for installing extensions in PythonBundle.

However for the sanity check of PythonBundle itself the variable is not defined (even if it was defined during the build) as the environment gets reset when loading the module used for the sanity check.

Hence use the same approach used in PythonPackage and set $PYTHONNOUSERSITE after loading the module.

Some PythonBundle ECs (e.g. IPython) use custom sanity checks using
python. That might pick up python packages installed to the users `$HOME`
which can yield wrong results.
We already take care of this for the extensions sanity check in PythonPackage and
for installing extensions in PythonBundle.
However for the sanity check of PythonBundle itself the variable is not
defined (even if it was defined during the build) as the environment
gets reset when loading the module used for the sanity check.
Hence use the same approach used in PythonPackage and set
`$PYTHONNOUSERSITE` after loading the module.
@Flamefire
Copy link
Contributor Author

Test report by @Flamefire

Overview of tested easyconfigs (in order)

  • SUCCESS IPython-7.18.1-GCCcore-10.2.0.eb

Build succeeded for 1 out of 1 (1 easyconfigs in total)
n1552 - Linux RHEL 8.9 (Ootpa), x86_64, Intel(R) Xeon(R) Platinum 8470 (icelake), Python 3.8.17
See https://gist.github.com/Flamefire/289e5201213f6908e3670003a1c3b0a2 for a full test report.

Copy link
Member

@boegel boegel left a comment

Choose a reason for hiding this comment

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

lgtm

@boegel boegel added this to the release after 4.9.2 milestone Sep 7, 2024
@boegel boegel merged commit c29c16d into easybuilders:develop Sep 7, 2024
41 checks passed
@Flamefire Flamefire deleted the pythonbundle-sanity-check branch September 9, 2024 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants