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

Build dependencies with no binary wheels don't work #5229

Closed
pv opened this issue Apr 15, 2018 · 9 comments · Fixed by #5336
Closed

Build dependencies with no binary wheels don't work #5229

pv opened this issue Apr 15, 2018 · 9 comments · Fixed by #5336
Labels
auto-locked Outdated issues that have been locked by automation type: support User Support

Comments

@pv
Copy link

pv commented Apr 15, 2018

  • Pip version: 10.0.0
  • Python version: 3.6.5
  • Operating system: Linux/Fedora

Description:

When installing dependencies given in pyproject.toml, pip does not seem to consider sdists on Pypi, only binary wheels.

That it only looks for binary wheels is not immediately expected, and does not seem to be mentioned in PEP 518. I think the correct behavior is that sdists are considered (although perhaps only if there are no binary wheels available).

What I've run:

The following is a reproducing shell script

# test.sh
set -e -x

rm -rf mytest
mkdir mytest
cd mytest

python3 -mvenv env
./env/bin/pip install --upgrade 'pip>=10'

echo "assert False" > setup.py
cat <<EOF > pyproject.toml
[build-system]
requires = [
    "wheel",
    "setuptools",
    "numpy==1.8.2",
]
EOF

./env/bin/pip wheel .

When I run this, I get

+ rm -rf mytest
+ mkdir mytest
+ cd mytest
+ python3 -mvenv env
+ ./env/bin/pip install --upgrade 'pip>=10'
Collecting pip>=10
  Using cached pip-10.0.0-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 9.0.3
    Uninstalling pip-9.0.3:
      Successfully uninstalled pip-9.0.3
Successfully installed pip-10.0.0
+ echo 'assert False'
+ cat
+ ./env/bin/pip wheel .
Processing /home/pauli/tmp/foo/mytest
  Could not find a version that satisfies the requirement numpy==1.8.2 (from versions: 1.11.3, 1.12.0rc2, 1.12.0, 1.12.1rc1, 1.12.1, 1.13.0rc1, 1.13.0rc2, 1.13.0, 1.13.1, 1.13.3, 1.14.0rc1, 1.14.0, 1.14.1, 1.14.2)
No matching distribution found for numpy==1.8.2

I would have expected this would succeed in installing the build dependencies. (And fail when it tries to run the setup.py --- in my real use I of course have a working setup.py but the behavior is the same).

If the version number is changed to e.g. numpy==1.11.3 for which Numpy has binary wheels on PyPi, it works as expected.

@pradyunsg
Copy link
Member

pradyunsg commented Apr 15, 2018

Hey @pv!

This is a known limitation of the current implementation of PEP 518 in pip 10 -- see https://pip.pypa.io/en/stable/reference/pip/#pep-518-support.

@pradyunsg pradyunsg added the type: support User Support label Apr 15, 2018
@pv
Copy link
Author

pv commented Apr 15, 2018

I only looked if you had open issues about the problem, and did not find such issues on this tracker.

@jorisvandenbossche
Copy link

Would it somehow be possible for pip to fall back to the "old" way (as if there would be no pyproject.toml file present) if this is failing? Because now this also makes that you cannot install with pip on platforms for which no wheels are available.

@pradyunsg
Copy link
Member

Yes. Just pass the --no-build-isolation option.

@jorisvandenbossche
Copy link

I actually was wondering if pip could do this automatically (given the limited support for pyproject.toml), but I suppose from the point of view of pip you will say that this is the responsibility of the user to specify it?

@rahulwa
Copy link

rahulwa commented May 8, 2018

How can I pass --no-build-isolation option through the environment variable? I tried like below but it did not work.
PIP_NO_BUILD_ISOLATION=true pip install pandas

@pfmoore
Copy link
Member

pfmoore commented May 8, 2018

Try PIP_NO_BUILD_ISOLATION=false. The way boolean flags are handled is a bit weird.

@rahulwa
Copy link

rahulwa commented May 8, 2018

Yes, this flag worked. Thanks @pfmoore

cjmayo added a commit to cjmayo/gnofract4d that referenced this issue May 26, 2019
From:
pypa/pip#5229

To avoid failure with Python 3.6:

 Downloading
https://files.pythonhosted.org/packages/c1/36/c31a6ce9411b22a8ac0759c9b5ffda09368d5e0643450bb8ed83c271588c/PyGObject-3.32.1.tar.gz
(698kB) Could not find a version that satisfies the requirement pycairo
(from versions: ) No matching distribution found for pycairo
cjmayo added a commit to cjmayo/gnofract4d that referenced this issue May 26, 2019
From:
pypa/pip#5229

To avoid failure with Python 3.6:

 Downloading
https://files.pythonhosted.org/packages/c1/36/c31a6ce9411b22a8ac0759c9b5ffda09368d5e0643450bb8ed83c271588c/PyGObject-3.32.1.tar.gz
(698kB) Could not find a version that satisfies the requirement pycairo
(from versions: ) No matching distribution found for pycairo
cjmayo added a commit to cjmayo/gnofract4d that referenced this issue May 26, 2019
From:
pypa/pip#5229

To avoid failure with Python 3.6:

 Downloading
https://files.pythonhosted.org/packages/c1/36/c31a6ce9411b22a8ac0759c9b5ffda09368d5e0643450bb8ed83c271588c/PyGObject-3.32.1.tar.gz
(698kB) Could not find a version that satisfies the requirement pycairo
(from versions: ) No matching distribution found for pycairo
@lock
Copy link

lock bot commented Jun 2, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 2, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation type: support User Support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants