-
Notifications
You must be signed in to change notification settings - Fork 658
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
setuptools setup_requires installs numpy/cython in unwanted locations #798
Comments
We still need it's KDTree implementation. |
Aww, chucks... |
Customized setup-time dependency installation to work around setuptools' problematic behavior (closes #798) Modified lazy dependency scheme to be less hacky (we now subclass distutils.Distribution). Removed use of Cython's build_ext (redundant with cythonize): https://groups.google.com/forum/#!topic/cython-users/fBWLUSJWod0
Customized setup-time dependency installation to work around setuptools' problematic behavior (closes #798) Modified lazy dependency scheme to be less hacky (we now subclass distutils.Distribution). Removed use of Cython's build_ext (redundant with cythonize): https://groups.google.com/forum/#!topic/cython-users/fBWLUSJWod0
Maybe we can eventually replace the KD-Tree with a grid-based search (maybe even multi-threaded and/or GPU accelerated backends?) which would also be better at handling PBC (would make #137 superfluous). Together with #777 (BioPython PDB handling) we could then keep it purely optional (only some minor things like |
I'll close this now. The discussions in #799 lead to the conclusion that all the extra code which depends on internal behaviour of setuptools that might change isn't worth the hand holding for users if we can just give them conda packages. |
I'm opening this more as a need to document these
setuptools
problems, so that the point of the corresponding PR is clearer.tl;dr:
setuptools
to lazily install build-time dependencies at setup-time, but it does a terrible job at it;pip
installs, but unfortunatelybiopython
's installer won't like it.Since PR #499 we've been relatively independent of having
numpy
preinstalled. #768 suggests we conditionally addCython
to the same lazy dependency scheme.That lazy dependency workaround makes use of
setuptools
'setup_requires
list. Unfortunately,setup_requires
is more of asetuptools
' kludge (don't get me started on the unholy mess the whole thing is...). The main downside is that whateversetuptools
downloads to satisfy setup-time dependencies ends up being installed in the current dir (!!). The system-wideeasy-install.pth
even gets a link to that current dir. This is dirty and insecure. (seesetuptools
issues 209 and 391; it's been dragging on for ages, one of the arguments being that people might rely by now on wrong behavior.)This problem also leads to issues if I install from source (
./setup.py install
) while not havingnumpy
:numpy
gets downloaded and installed under the source dir;MDAnalysis
gets built and installed system-wide;import MDAnalysis
fails with anImportError
because it can't findnumpy
.I'm addressing this together with #768 in an upcoming PR by customizing the dependency installation.
I'd like to move dependency installation to build-time, so that
pip install .
doesn't even trigger that dependency workaround, which depends too much onsetuptools
for my liking (in that setting,pip
seesMDAnalysis
needsnumpy
and by the time we get to buildMDAnalysis
that dependency is already met). However,biopython
isn't as clever as us, and merely listing its dependencies requiresnumpy
. Therefore I'm havingMDAnalysis
look for and install build-time dependencies as soon as it detects its being probed bypip
(dependency installation is done directly viasetuptools
, even if in the process of apip
install). This way, by the time we get to probingbiopython
all is in place (if we get rid ofbiopython
, see #777, then even better!).The text was updated successfully, but these errors were encountered: