diff options
author | Adam J. Stewart <ajstewart426@gmail.com> | 2021-07-16 10:28:00 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-16 08:28:00 -0700 |
commit | c37df94932260fe3e5f22381af03587662569f7e (patch) | |
tree | 003d87d6ce47ecae431ecb44cf0c55516b6359ef /.github/CONTRIBUTING.md | |
parent | 64f31c457923c7e4cb00fe28d83431e67761d56e (diff) | |
download | spack-c37df94932260fe3e5f22381af03587662569f7e.tar.gz spack-c37df94932260fe3e5f22381af03587662569f7e.tar.bz2 spack-c37df94932260fe3e5f22381af03587662569f7e.tar.xz spack-c37df94932260fe3e5f22381af03587662569f7e.zip |
Python: query distutils to find site-packages directory (#24095)
Third-party Python libraries may be installed in one of several directories:
1. `lib/pythonX.Y/site-packages` for Spack-installed Python
2. `lib64/pythonX.Y/site-packages` for system Python on RHEL/CentOS/Fedora
3. `lib/pythonX/dist-packages` for system Python on Debian/Ubuntu
Previously, Spack packages were hard-coded to use the (1). Now, we query the Python installation itself and ask it which to use. Ever since #21446 this is how we've been determining where to install Python libraries anyway.
Note: there are still many packages that are hard-coded to use (1). I can change them in this PR, but I don't have the bandwidth to test all of them.
* Python: handle dist-packages and site-packages
* Query Python to find site-packages directory
* Add try-except statements for when distutils isn't installed
* Catch more errors
* Fix root directory used in import tests
* Rely on site_packages_dir property
Diffstat (limited to '.github/CONTRIBUTING.md')
0 files changed, 0 insertions, 0 deletions