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
Require numpy and specify this in setup.py #1307
Conversation
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.
Looks good to me overall. Is the sys.exit necessary? What are the consequences of leaving it out?
Well it used to be |
Note to self: We should as part of this remove |
|
Codecov Report
@@ Coverage Diff @@
## master #1307 +/- ##
==========================================
+ Coverage 83.35% 84.23% +0.87%
==========================================
Files 317 318 +1
Lines 48655 48712 +57
==========================================
+ Hits 40558 41031 +473
+ Misses 8097 7681 -416
Continue to review full report at Codecov.
|
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.
This looks ok @peterjc , I did a local install test on a Linux box and installation feels smoother now.
Thanks @bow - that's good to hear. In my local testing using Python 3.6,
vs:
Note thanks to the NumPy wheels, installing NumPy is very fast. |
Cope with it being missing on Jython or IronPython.
Now that we've dropped distutils in favour of using setuptools we can provide the install_requires list. For a library this is prefered over requirements.txt (which is intended more for an application).
Since we now require setuptools, single-version-externally-managed should be there already.
@etal It seems that If I remove our dependency check functions (which means i.e. Right now our sublcassed methods like (i.e. I'm being cautious - we're already changing a lot in the After Biopython 1.70 is out, and assuming pip works perfectly in the field, we can remove all references to using |
Now that we insist on NumPy (expect on Jython/IronPython), setup.py will not prompt for continuing if NumPy is missing.
Thanks everyone - this is another step towards a modern installation setup 👍 |
I have a feedback. I'm very glad that installing biopython is now works flawlessly no matter what. But there's a very small roughness left. I think you should specify this on your readme. BioLinux is a fork of ubuntu 14.04LTS which comes with python3.4, setuptools 3.3 and pip 1.5.4 (ancient!). When you create a virtual environment and try installing biopython, pip doesn't check the install_requires statement, thus throwing an error. But if you upgrade pip there's no problem at all. I think a simple suggestion of "Consider upgrading pip before installing biopython" would be great.
This was no issue for me as I always keep pip and setuptools up to date, faced with this issue many times before with so many packages. 👍 Great work. |
@Cediddi do you know when pip started checking i.e. How old does |
I'm not sure, 1.5.4 is pretty ancient after all. But It's always best to
have latest pip because 1.5.4 also doesn't support wheels (which might be
the root cause, I'm not sure on install_requires).
On Oct 30, 2017 13:50, "Peter Cock" <notifications@github.com> wrote:
@Cediddi <https://github.com/cediddi> do you know when pip started checking
install_requires? https://pip.pypa.io/en/stable/news/ does not mention it
directly.
i.e. How old does pip need to be before it is worth issuing a warning, or
even aborting?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1307 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACmDYGfGzT5moztuXMPSz3P-ufYkvRPkks5sxankgaJpZM4OMih8>
.
|
I skimmed over https://pip.pypa.io/en/stable/news/ and there are so many wheel or other important changes that it is hard to know at what point pip is going to be too old. Would picking an arbitrary threshold like pip version 8.0.0 seem like a good compromise (released 2016-01-19)? i.e. Abort if pip is older than this, abort with a message saying pip is too old, try (We can of course easily make that check stricter if and when we realise we really do need an even newer version of pip) |
Just created two virtual environments one with pip==8.0.0 other with pip==9.0.1 (that hotfix is important) Pip 8 downloaded biopython-1.70.tar.gz and numpy-1.13.3.zip and started compiling numpy and then installed biopython without an error. (so not supporting wheels is not the issue after all) Pip 9 downloaded biopython-1.70-cp34-cp34m-manylinux1_x86_64.whl and numpy-1.13.3-cp34-cp34m-manylinux1_x86_64.whl and installed without a problem and was faster because not compiling the packages. I think Pip <6 should abort installation, Pip >6,<9 should warn and say "You should consider upgrading via the 'pip install --upgrade pip' command for using precompiled wheels". If I had no gcc laying around, Pip 9 would still work I presume. PS: I also tried Pip 7 and it worked just like Pip 8. Pip 6 also worked but gave a warning PPS: Pip jumped from 1.5.6 to 6.0 I didn't bothered with 1.5.6. PPPS: You can actually do something very interesting with pip 6 and onwards:
|
Your plan sounds good @Cediddi, could you open a new issue for that proposal please? |
This pull request makes NumPy a hard requirement (except on Jython and IronPython). This in itself massively simplifies the
setup.py
file - and once we drop Jython (and IronPython) we can go further.This does mean it is no longer going to be possible to install Biopython on PyPy or C Python without NumPy - currently allowed via a user interaction.
Having made that change, and given we've dropped
distutils
in favour of assumingsetuptools
will be present, as per pypa/packaging-problems#78 and https://caremad.io/posts/2013/07/setup-vs-requirement/ we should specify our (now strict) dependency on NumPy viasetup(..., install_requires=...)
rather thanrequirements.txt
(see #987).I believe this means we after this release is on PyPI be able to simplify the current README installation instructions from:
to just:
This should address #1302 and should more fully resolve #978.