Skip to content
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

Add pyproject.toml to resolve build dependency on NumPy #806

Merged
merged 1 commit into from
Apr 11, 2019

Conversation

al42and
Copy link
Contributor

@al42and al42and commented Feb 22, 2019

Hello!

When trying to install ProDy into a clean environment using pip and requirements.txt, sometimes pip tries to install ProDy before NumPy, and it causes No files/directories in /tmp/pip-build-xxxxxxx/prody/pip-egg-info (from PKG-INFO) error (which is not very helpful).

Here's a Dockerfile to reproduce (same on 18.04):

FROM ubuntu:16.04
RUN apt-get update && apt-get -y install python3 virtualenv build-essential && apt-get clean
RUN virtualenv -p python3 venv
RUN printf "numpy>=1.10\nscipy>=0.16\nprody>=1.8.2" > /requirements.txt
RUN bash -c 'source venv/bin/activate && pip install -r /requirements.txt'
CMD ["/bin/bash"]

Doing pip install in two-step (first, install NumPy and SciPy, and only afterward install ProDy) works, but is rather inconvenient.

ProDy is far from the first project that encountered this problem, and it seems the way to solve it is by using pyproject.toml.

Unfortunately, it is supported only by recent versions of pip>=10.0. However, if one is using VirtualEnv, that should be okay.

I haven't tested the proposed solution extensively, but it solves the issue for me at least.

At least with recent versions of pip (>=10.0)
@jamesmkrieger
Copy link
Contributor

We'd rather have everything compatible with whatever version of pip so inconvenient sometimes but still workable is better than failing completely other times. What happens if you introduce this and then install ProDy with pip < 10? Does it still work with the inconvenient method?

@al42and
Copy link
Contributor Author

al42and commented Apr 4, 2019

I tested, and it still works. I just introduce a new file. pip>=10 takes advantage of it and preinstalls numpy; the behavior of older versions of pip is not affected.

Also, it should be noted: pyproject.toml installs numpy temporarily for installation. It is still necessary to list numpy in requirements.txt (or whatever is used instead) for actual use of ProDy.

@SHZ66
Copy link
Collaborator

SHZ66 commented Apr 11, 2019

I tend to agree with this change. As tested, it doesn't hurt if the user is using an older version of pip, and the user could benefit from this if he/she is using a newer version. Thank you very much for the fix.

@SHZ66 SHZ66 merged commit 25fd53b into prody:master Apr 11, 2019
@al42and al42and deleted the pyproject_toml branch April 11, 2019 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants