-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Python: improve site_packages_dir handling #28346
Python: improve site_packages_dir handling #28346
Conversation
Hi @adamjstewart! I noticed that the following package(s) don't yet have maintainers:
Are you interested in adopting any of these package(s)? If so, simply add the following to the package class: maintainers = ['adamjstewart'] If not, could you contact the developers of this package and see if they are interested? You can quickly see who has worked on a package with $ spack blame hoomd-blue Thank you for your help! Please don't add maintainers without their consent. You don't have to be a Spack expert or package developer in order to be a "maintainer," it just gives us a list of users willing to review PRs or debug issues relating to this package. A package can have multiple maintainers; just add a list of GitHub handles of anyone who wants to volunteer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments, may or may not be worth addressing but I'll approve and defer to you on whether to make any changes before merging.
@becker33 ready for another round of review. All usage of |
@spackbot run pipeline |
I've started that pipeline for you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming the pipeline comes back successful, I think the platlib vs purelib decisions look reasonable.
Failing build systems check in GitLab CI will be fixed by #28360. |
45d9f34
to
9670cd6
Compare
@becker33 @scheibelp is this good to go? |
* Python: improve site_packages_dir handling * Replace all site_packages_dir with purelib/platlib
* Python: improve site_packages_dir handling * Replace all site_packages_dir with purelib/platlib
* Python: improve site_packages_dir handling * Replace all site_packages_dir with purelib/platlib
* Python: improve site_packages_dir handling * Replace all site_packages_dir with purelib/platlib
This PR includes the following changes. I'll do my best to provide the background and motivation behind these changes. Some of these changes were extracted from #27798, which will be rebased after this is merged.
sysconfig
instead ofdistutils.sysconfig
In Python 3.10, the
distutils
module has been deprecated. In Python 3.12, it will be removed entirely. To future-proof our Python build system, we should usesysconfig
instead (added in Python 2.7 and 3.2). Also, the Debian/Ubuntu system Python contains a bug wheredistutils.sysconfig
andsysconfig
return different purelib/platlib paths. Since build backends like setuptools usesysconfig
, we also need to usesysconfig
for compatibility.PYTHONPATH
On the majority of systems, purelib and platlib are identical, providing the location where third-party Python libraries are installed. Historically, we've been calling this
site_packages_dir
. However, when using the system Python on RHEL/CentOS/Fedora, purelib useslib
while platlib useslib64
. Different packages will end up in different directories depending on whether they contain C/C++ code or are written in pure Python. Since Spack has no way of knowing this, we should always add both purelib and platlib to thePYTHONPATH
.PYTHONPATH
Previously we were recursively adding all build/run/test dependencies. However, this caused build deps of build deps to be added. The correct solution is to add all direct build/run/test deps, and all recursive run deps of those.
External references
Fixes #15304
Fixes #20043
Fixes #22299
Fixes #24076
Fixes #26546
Fixes #27497