Conversation
|
@adamjstewart @lee218llnl: care to test this out? |
|
Wow, that was quick. It turns out it doesn't solve my immediate performance issue (even with no sys.path search misses, we're still pounding the filesystem too hard), but as you point out, it's unnecessary, obsolete, and plain messy. I'm glad it's ticked off the list...
|
|
@tgamblin I will try to build a bunch of packages and test them out. |
|
@tgamblin, this is breaking py-basemap: Currently the py-basemap packages lists py-setuptools as a dependence, even though it doesn't directly depend on it. Even if we remove that, though, some of py-basemap's dependences do depend on py-setuptools, so py-setuptools appears in py-basemaps spec. Is there anyway to make it so that this arg is only added when py-setuptools is a direct dependence (and then we can separately fix py-basemap)? |
|
@citibeth: in this case it's actually what @lee218llnl pointed out -- my check in |
|
@lee218llnl @adamjstewart: ok, I got I felt adventurous and tried installing @krafczyk: I ended up cleaning up a few dependencies of
|
|
@tgamblin, I'll have a look. |
|
I agree with all of the setuptools dependency changes. |
|
@tgamblin looks good for py-basemap, thanks. |
|
@tgamblin, I had to add a couple of commits for missing dependencies for matplotlib and yt. After these changes I'm good with this PR. I've added the commits to features/no-python-eggs on my spack fork, pull from that branch to get my changes. |
|
@tgamblin This PR is great. I have started to install all Python packages, and found some more setuptools dependency problems. The fixes can be found at in my repo and listed below: Add required setuptools dependency:
Remove unneeded setuptools dependency:
|
|
@paulhopkins: thanks! I added you as a collaborator, so you should be able to push to this branch now. Do you mind pushing your updates here? |
|
Thanks @tgamblin, I have uploaded my changes. I have not yet managed to install py-pyqt but I will try and look at it later. |
|
@paulhopkins: is that the only one you haven't tried yet? |
|
@tgamblin I have 'tried' them all, but these are the ones that have failed: py-pyqt: Fails to find Phonon headers. These should be QT package, but they are not there. py-yt, Fixed by @krafczyk py-meep, Meep did not install Fixed in new commit: |
|
|
|
Would it make sense for this PR to eliminate the EDIT: I overlooked this part of the original message:
I'm curious: why would a package want to override this? There aren't currently any python modules in Spack's default repo that do this. |
- Spack doesn't need eggs -- it manages its own directories
- Simplify install layout and reduce sys.path searches by installing all
packages flat (eggs are deprecated for wheels, and this is also what
wheels do).
- We now supply the --single-version-externally-managed argument to
`setup.py install` for setuptools packages and setuptools.
- modify packages to only use setuptools args if setuptools is an
immediate dependency
- Remove setuptools from packages that do not need it.
- Some packages use setuptools *only* when certain args (likeb
'develop' or 'bdist') are supplied to setup.py, and they specifically
do not use setuptools for installation.
- Spack never calls setup.py this way, so just removing the setuptools
dependency works for these packages.
- add setuptools dependencies to packages that need it. - remove setuptools from packages that do not need it.
3a38dad to
069c3c3
Compare
|
I rebased this and included the changes from @paulhopkins and @krafczyk, so it should be ready to go. |
I don't know, but I don't think it's good practice to break the functionality. I'm almost positive that Python packages wouldn't want to use eggs if building with Spack. But |
|
Todd,
Just by the way, the system I've come up with for managing sys.path makes considerable use of .pth files. It seems much less fragile than relying on PYTHONPATH (although arguably less flexible, since it's harder to override). I've also used the egg trick of stacking executable python code on an import line in a .pth file, in two distinct use cases:
(1) To put $SYS_TYPE dependent directory names into sys.path (a .pth file seems a very logical place for this).
(2) To start my "import recorder" code.
Number (2) is interesting because the .pth parsing occurs far earlier in the python startup than any other point you can access. If you need your code to run very early, it's your best option. It even works for hydra's embedded python, getting in even before the compiled code begins its imports, so it's very useful for embedded python instances as well.
Anyway, please don't do anything that would break the .pth file processing...
Dave
From: Todd Gamblin <[email protected]>
Reply-To: LLNL/spack <[email protected]>
Date: Friday, April 21, 2017 at 4:28 PM
To: LLNL/spack <[email protected]>
Cc: David Munro <[email protected]>, Mention <[email protected]>
Subject: Re: [LLNL/spack] Don't build eggs. (#3587)
@scheibelp<https://github.com/scheibelp>:
I'm curious: why would a package want to override this? There aren't currently any python modules in Spack's default repo that do this.
I don't know, but I don't think it's good practice to break the functionality. I'm almost positive that Python packages wouldn't want to use eggs if building with Spack. But .pth files are one way that Python knows how to do imports, and if there is a package that relies on them, or a site that somehow depends on them, I don't want to make Spack break a Python feature if we don't have to.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#3587 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AAlgrXzy_ZSVgdaSv_5hbXt12ZmAAongks5ryTuWgaJpZM4Mr6O0>.
{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/LLNL/spack","title":"LLNL/spack","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/LLNL/spack"}},"updates":{"snippets":[{"icon":"PERSON","message":"@tgamblin in #3587: @scheibelp: \r\n\r\n\u003e I'm curious: why would a package want to override this? There aren't currently any python modules in Spack's default repo that do this.\r\n\r\nI don't know, but I don't think it's good practice to break the functionality. I'm almost positive that Python packages wouldn't want to use eggs if building with Spack. But `.pth` files are one way that Python knows how to do imports, and if there is a package that relies on them, or a site that somehow depends on them, I don't want to make Spack break a Python feature if we don't have to."}],"action":{"name":"View Pull Request","url":"#3587 (comment)"}}}
|
- py-setuptools is required by py-yt for importing yt in jupyter notebooks. - add two dependencies needed for python 2.7 - add the py-subprocess32 package
069c3c3 to
dcdd37a
Compare
|
@adamjstewart in 8d0758f you added the following function to Doesn't this conflict with this change here? I think we ran into this problem when one of our packages has to link against numpy on a barebone Debian. I fear that we didn't note this prior because we always worked on systems where a non-spack numpy was available. |
|
Probably? |
|
Okay, I'll have a PR for that in a couple of days, unfortunately I was unable to build |
|
Yeah, I noticed that as well. |
PythonPackage now builds flat installs instead of egg directories.
@dhmunro noticed that eggs cause extra filesystem operations and more poking around on
sys.path, which will cause slowdowns on HPC runs. Yes, you can use Spindle for that, and we do, but there are other good reasons to use a flat layout instead of eggs:Spack doesn't need eggs -- it manages its own directories and symlinks extensions into place.
Eggs are deprecated for wheels, and wheels install flat.
We don't have to do all the
easy-install.pthmerging (fix easy-install.pth #3569, Restore newlines to easy-install.pth files. #3583), though we should still support that for packages that want to override this behavior for some reason.We now supply the --single-version-externally-managed argument to
setup.py installfor setuptools packages and setuptools.