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

--no-binary :all: option not taken into account when building from source #7248

Closed
SylvainCorlay opened this issue Oct 20, 2019 · 18 comments
Closed
Labels
state: needs reproducer Need to reproduce issue type: support User Support

Comments

@SylvainCorlay
Copy link

Environment

  • pip version: Tested with 19.1.1
  • Python version: 3.7.3
  • OS: All

Description

Disabling the building of an intermediate wheel appears to work when installing a package from and sdist (either on PyPI) or a local sdist tarball.
However, the option does not appear to be taken into account when doing

pip install --no-binary :all: .

in the source directory.

Expected behavior

I expect the behavior to be the same when building an sdist or building from source in that regard.

How to Reproduce

Build a python package from source with --no-binary :all: and check that a python wheel is created.

@triage-new-issues triage-new-issues bot added the S: needs triage Issues/PRs that need to be triaged label Oct 20, 2019
@chrahunt
Copy link
Member

chrahunt commented Oct 20, 2019

Hi @SylvainCorlay. I am not able to reproduce this on Ubuntu 18.04 with Python 3.7.2 with either pip 19.1.1 or 19.3.1 with:

repro.sh
#!/bin/sh
set -ex
cd "$(mktemp -d)"
echo "from setuptools import setup; setup(name='hello')" > setup.py
python -m venv env
env/bin/python -m pip install --upgrade pip==19.1.1 wheel
echo - Should not build wheel -------------------------------------------------
env/bin/python -m pip install --no-binary :all: .
echo - Should build wheel -----------------------------------------------------
env/bin/python -m pip install .

env/bin/python -m pip install --upgrade pip
echo - Should not build wheel -------------------------------------------------
env/bin/python -m pip install --no-binary :all: .
echo - Should build wheel -----------------------------------------------------
env/bin/python -m pip install .
Output
+ mktemp -d
+ cd /tmp/user/1000/tmp.fMYcTkDQfz
+ echo from setuptools import setup; setup(name='hello')
+ python -m venv env
+ env/bin/python -m pip install --upgrade pip==19.1.1 wheel
Collecting pip==19.1.1
  Using cached https://files.pythonhosted.org/packages/5c/e0/be401c003291b56efc55aeba6a80ab790d3d4cece2778288d65323009420/pip-19.1.1-py2.py3-none-any.whl
Collecting wheel
  Using cached https://files.pythonhosted.org/packages/00/83/b4a77d044e78ad1a45610eb88f745be2fd2c6d658f9798a15e384b7d57c9/wheel-0.33.6-py2.py3-none-any.whl
Installing collected packages: pip, wheel
  Found existing installation: pip 18.1
    Uninstalling pip-18.1:
      Successfully uninstalled pip-18.1
Successfully installed pip-19.1.1 wheel-0.33.6
+ echo - Should not build wheel -------------------------------------------------
- Should not build wheel -------------------------------------------------
+ env/bin/python -m pip install --no-binary :all: .
Processing /tmp/user/1000/tmp.fMYcTkDQfz
Skipping bdist_wheel for hello, due to binaries being disabled for it.
Installing collected packages: hello
  Running setup.py install for hello ... done
Successfully installed hello-0.0.0
WARNING: You are using pip version 19.1.1, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
+ echo - Should build wheel -----------------------------------------------------
- Should build wheel -----------------------------------------------------
+ env/bin/python -m pip install .
Processing /tmp/user/1000/tmp.fMYcTkDQfz
Building wheels for collected packages: hello
  Building wheel for hello (setup.py) ... done
  Stored in directory: /tmp/user/1000/pip-ephem-wheel-cache-by4ifp8j/wheels/d9/1c/4e/98fe82a47591b710b16705eb728b6eb1ff263cd576c81f755d
Successfully built hello
Installing collected packages: hello
  Found existing installation: hello 0.0.0
    Uninstalling hello-0.0.0:
      Successfully uninstalled hello-0.0.0
Successfully installed hello-0.0.0
WARNING: You are using pip version 19.1.1, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
+ env/bin/python -m pip install --upgrade pip
Collecting pip
  Using cached https://files.pythonhosted.org/packages/00/b6/9cfa56b4081ad13874b0c6f96af8ce16cfbc1cb06bedf8e9164ce5551ec1/pip-19.3.1-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 19.1.1
    Uninstalling pip-19.1.1:
      Successfully uninstalled pip-19.1.1
Successfully installed pip-19.3.1
+ echo - Should not build wheel -------------------------------------------------
- Should not build wheel -------------------------------------------------
+ env/bin/python -m pip install --no-binary :all: .
Processing /tmp/user/1000/tmp.fMYcTkDQfz
Skipping wheel build for hello, due to binaries being disabled for it.
Installing collected packages: hello
  Found existing installation: hello 0.0.0
    Uninstalling hello-0.0.0:
      Successfully uninstalled hello-0.0.0
    Running setup.py install for hello ... done
Successfully installed hello-0.0.0
+ echo - Should build wheel -----------------------------------------------------
- Should build wheel -----------------------------------------------------
+ env/bin/python -m pip install .
Processing /tmp/user/1000/tmp.fMYcTkDQfz
Building wheels for collected packages: hello
  Building wheel for hello (setup.py) ... done
  Created wheel for hello: filename=hello-0.0.0-cp37-none-any.whl size=970 sha256=c8bee54fbd627f93e58769bbd2ac7f34fb558a571cdf35f1e986d33201897730
  Stored in directory: /tmp/user/1000/pip-ephem-wheel-cache-vmaf_61a/wheels/d9/1c/4e/98fe82a47591b710b16705eb728b6eb1ff263cd576c81f755d
Successfully built hello
Installing collected packages: hello
  Found existing installation: hello 0.0.0
    Uninstalling hello-0.0.0:
      Successfully uninstalled hello-0.0.0
Successfully installed hello-0.0.0

Note in the output that pip indicates it is not building a wheel for the invocations that have --no-binary :all:.

Can you please adapt the script above to demonstrate your issue? One approach could be to make the small project look similar to the project for which you're having the issue.

@chrahunt chrahunt added S: awaiting response Waiting for a response/more information state: needs reproducer Need to reproduce issue type: support User Support labels Oct 20, 2019
@triage-new-issues triage-new-issues bot removed the S: needs triage Issues/PRs that need to be triaged label Oct 20, 2019
@SylvainCorlay
Copy link
Author

SylvainCorlay commented Oct 21, 2019

The package for which I am seeing this issue is ipykernel

I have to disable build isolation for this package because flit does not appear to build from source dist (cf ipython/ipykernel#450)

git clone https://github.com/ipython/ipykernel.git
cd ipykernel
python -m venv env
echo - Should not build wheel -------------------------------------------------
env/bin/python -m pip install --no-binary :all: -no-build-isolation .
echo - Should build wheel -----------------------------------------------------
env/bin/python -m pip install .

The output shows

Building wheels for collected packages: ipykernel
  Building wheel for ipykernel (PEP 517) ... done

@no-response no-response bot removed the S: awaiting response Waiting for a response/more information label Oct 21, 2019
@chrahunt
Copy link
Member

The arguments seem to be out of order, can you please try

env/bin/python -m pip install --no-build-isolation --no-binary :all: .

Locally that works for me without building wheels.

Also please note that the issue with flit installing from sdist should be fixed by #6606, which was included in pip 19.3.1.

@chrahunt chrahunt added the S: awaiting response Waiting for a response/more information label Oct 21, 2019
@no-response no-response bot removed the S: awaiting response Waiting for a response/more information label Oct 21, 2019
@SylvainCorlay
Copy link
Author

Obviously I meant env/bin/python -m pip install --no-binary :all: -no-build-isolation . in the right order.

I am still seeing the wheel being built.

@chrahunt
Copy link
Member

Sorry, any little detail can cause issues like this, so we can't take anything for granted even if it may be "obvious" in a normal situation.

Can you please re-run the command giving you the unexpected result with --verbose and provide the full output and the command?

@chrahunt chrahunt added the S: awaiting response Waiting for a response/more information label Oct 21, 2019
@SylvainCorlay
Copy link
Author

SylvainCorlay commented Oct 21, 2019

Output
pip install --no-build-isolation --no-binary :all: --verbose .
Created temporary directory: /tmp/pip-ephem-wheel-cache-9ultri8d
Created temporary directory: /tmp/pip-req-tracker-ofbi5z30
Created requirements tracker '/tmp/pip-req-tracker-ofbi5z30'
Created temporary directory: /tmp/pip-install-xxt8v_s9
Processing /home/sylvain/dev/ipython/ipykernel
  Created temporary directory: /tmp/pip-req-build-spvcrne3
  Added file:///home/sylvain/dev/ipython/ipykernel to build tracker '/tmp/pip-req-tracker-ofbi5z30'
    Created temporary directory: /tmp/pip-modern-metadata-afl226n9
    Running command /home/sylvain/miniconda3/bin/python /home/sylvain/miniconda3/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpmnqrp2tf
    running dist_info
    creating /tmp/pip-modern-metadata-afl226n9/ipykernel.egg-info
    writing /tmp/pip-modern-metadata-afl226n9/ipykernel.egg-info/PKG-INFO
    writing dependency_links to /tmp/pip-modern-metadata-afl226n9/ipykernel.egg-info/dependency_links.txt
    writing requirements to /tmp/pip-modern-metadata-afl226n9/ipykernel.egg-info/requires.txt
    writing top-level names to /tmp/pip-modern-metadata-afl226n9/ipykernel.egg-info/top_level.txt
    writing manifest file '/tmp/pip-modern-metadata-afl226n9/ipykernel.egg-info/SOURCES.txt'
    reading manifest file '/tmp/pip-modern-metadata-afl226n9/ipykernel.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no previously-included files found matching 'docs/#*'
    no previously-included directories found matching 'docs/_build'
    no previously-included directories found matching 'docs/gh-pages'
    no previously-included directories found matching 'docs/dist'
    warning: no previously-included files matching '*~' found anywhere in distribution
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '*.pyo' found anywhere in distribution
    warning: no previously-included files matching '.git' found anywhere in distribution
    warning: no previously-included files matching '.ipynb_checkpoints' found anywhere in distribution
    no previously-included directories found matching 'data_kernelspec'
    writing manifest file '/tmp/pip-modern-metadata-afl226n9/ipykernel.egg-info/SOURCES.txt'
    creating '/tmp/pip-modern-metadata-afl226n9/ipykernel.dist-info'
    Preparing wheel metadata ... done
  Source in /tmp/pip-req-build-spvcrne3 has version 5.1.3, which satisfies requirement ipykernel==5.1.3 from file:///home/sylvain/dev/ipython/ipykernel
  Removed ipykernel==5.1.3 from file:///home/sylvain/dev/ipython/ipykernel from build tracker '/tmp/pip-req-tracker-ofbi5z30'
Requirement already satisfied: tornado>=4.2 in /home/sylvain/miniconda3/lib/python3.7/site-packages (from ipykernel==5.1.3) (6.0.3)
Requirement already satisfied: ipython>=5.0.0 in /home/sylvain/miniconda3/lib/python3.7/site-packages (from ipykernel==5.1.3) (7.8.0)
Requirement already satisfied: jupyter-client in /home/sylvain/miniconda3/lib/python3.7/site-packages (from ipykernel==5.1.3) (5.3.3)
Requirement already satisfied: traitlets>=4.1.0 in /home/sylvain/miniconda3/lib/python3.7/site-packages (from ipykernel==5.1.3) (4.3.3)
Requirement already satisfied: prompt-toolkit<2.1.0,>=2.0.0 in /home/sylvain/miniconda3/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel==5.1.3) (2.0.10)
Requirement already satisfied: backcall in /home/sylvain/miniconda3/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel==5.1.3) (0.1.0)
Requirement already satisfied: setuptools>=18.5 in /home/sylvain/miniconda3/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel==5.1.3) (41.4.0)
Requirement already satisfied: pickleshare in /home/sylvain/miniconda3/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel==5.1.3) (0.7.5)
Requirement already satisfied: pexpect; sys_platform != "win32" in /home/sylvain/miniconda3/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel==5.1.3) (4.7.0)
Requirement already satisfied: pygments in /home/sylvain/miniconda3/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel==5.1.3) (2.4.2)
Requirement already satisfied: decorator in /home/sylvain/miniconda3/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel==5.1.3) (4.4.0)
Requirement already satisfied: jedi>=0.10 in /home/sylvain/miniconda3/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel==5.1.3) (0.15.1)
Requirement already satisfied: pyzmq>=13 in /home/sylvain/miniconda3/lib/python3.7/site-packages (from jupyter-client->ipykernel==5.1.3) (18.1.0)
Requirement already satisfied: python-dateutil>=2.1 in /home/sylvain/miniconda3/lib/python3.7/site-packages (from jupyter-client->ipykernel==5.1.3) (2.8.0)
Requirement already satisfied: jupyter-core in /home/sylvain/miniconda3/lib/python3.7/site-packages (from jupyter-client->ipykernel==5.1.3) (4.5.0)
Requirement already satisfied: six in /home/sylvain/miniconda3/lib/python3.7/site-packages (from traitlets>=4.1.0->ipykernel==5.1.3) (1.12.0)
Requirement already satisfied: ipython-genutils in /home/sylvain/miniconda3/lib/python3.7/site-packages (from traitlets>=4.1.0->ipykernel==5.1.3) (0.2.0)
Requirement already satisfied: wcwidth in /home/sylvain/miniconda3/lib/python3.7/site-packages (from prompt-toolkit<2.1.0,>=2.0.0->ipython>=5.0.0->ipykernel==5.1.3) (0.1.7)
Requirement already satisfied: ptyprocess>=0.5 in /home/sylvain/miniconda3/lib/python3.7/site-packages (from pexpect; sys_platform != "win32"->ipython>=5.0.0->ipykernel==5.1.3) (0.6.0)
Requirement already satisfied: parso>=0.5.0 in /home/sylvain/miniconda3/lib/python3.7/site-packages (from jedi>=0.10->ipython>=5.0.0->ipykernel==5.1.3) (0.5.1)
Building wheels for collected packages: ipykernel
  Created temporary directory: /tmp/pip-wheel-e37bh00v
  Destination directory: /tmp/pip-wheel-e37bh00v
  Running command /home/sylvain/miniconda3/bin/python /home/sylvain/miniconda3/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmpmed8xsdy
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib
  copying ipykernel_launcher.py -> build/lib
  creating build/lib/ipykernel
  copying ipykernel/pickleutil.py -> build/lib/ipykernel
  copying ipykernel/embed.py -> build/lib/ipykernel
  copying ipykernel/kernelapp.py -> build/lib/ipykernel
  copying ipykernel/jsonutil.py -> build/lib/ipykernel
  copying ipykernel/connect.py -> build/lib/ipykernel
  copying ipykernel/zmqshell.py -> build/lib/ipykernel
  copying ipykernel/iostream.py -> build/lib/ipykernel
  copying ipykernel/heartbeat.py -> build/lib/ipykernel
  copying ipykernel/kernelspec.py -> build/lib/ipykernel
  copying ipykernel/eventloops.py -> build/lib/ipykernel
  copying ipykernel/__init__.py -> build/lib/ipykernel
  copying ipykernel/_version.py -> build/lib/ipykernel
  copying ipykernel/_eventloop_macos.py -> build/lib/ipykernel
  copying ipykernel/ipkernel.py -> build/lib/ipykernel
  copying ipykernel/codeutil.py -> build/lib/ipykernel
  copying ipykernel/displayhook.py -> build/lib/ipykernel
  copying ipykernel/parentpoller.py -> build/lib/ipykernel
  copying ipykernel/datapub.py -> build/lib/ipykernel
  copying ipykernel/serialize.py -> build/lib/ipykernel
  copying ipykernel/__main__.py -> build/lib/ipykernel
  copying ipykernel/kernelbase.py -> build/lib/ipykernel
  copying ipykernel/log.py -> build/lib/ipykernel
  creating build/lib/ipykernel/tests
  copying ipykernel/tests/test_embed_kernel.py -> build/lib/ipykernel/tests
  copying ipykernel/tests/_asyncio_utils.py -> build/lib/ipykernel/tests
  copying ipykernel/tests/test_jsonutil.py -> build/lib/ipykernel/tests
  copying ipykernel/tests/test_connect.py -> build/lib/ipykernel/tests
  copying ipykernel/tests/test_eventloop.py -> build/lib/ipykernel/tests
  copying ipykernel/tests/test_heartbeat.py -> build/lib/ipykernel/tests
  copying ipykernel/tests/__init__.py -> build/lib/ipykernel/tests
  copying ipykernel/tests/test_zmq_shell.py -> build/lib/ipykernel/tests
  copying ipykernel/tests/test_serialize.py -> build/lib/ipykernel/tests
  copying ipykernel/tests/test_pickleutil.py -> build/lib/ipykernel/tests
  copying ipykernel/tests/test_async.py -> build/lib/ipykernel/tests
  copying ipykernel/tests/test_io.py -> build/lib/ipykernel/tests
  copying ipykernel/tests/utils.py -> build/lib/ipykernel/tests
  copying ipykernel/tests/test_start_kernel.py -> build/lib/ipykernel/tests
  copying ipykernel/tests/test_kernelspec.py -> build/lib/ipykernel/tests
  copying ipykernel/tests/test_message_spec.py -> build/lib/ipykernel/tests
  copying ipykernel/tests/test_kernel.py -> build/lib/ipykernel/tests
  creating build/lib/ipykernel/pylab
  copying ipykernel/pylab/backend_inline.py -> build/lib/ipykernel/pylab
  copying ipykernel/pylab/__init__.py -> build/lib/ipykernel/pylab
  copying ipykernel/pylab/config.py -> build/lib/ipykernel/pylab
  creating build/lib/ipykernel/comm
  copying ipykernel/comm/comm.py -> build/lib/ipykernel/comm
  copying ipykernel/comm/__init__.py -> build/lib/ipykernel/comm
  copying ipykernel/comm/manager.py -> build/lib/ipykernel/comm
  creating build/lib/ipykernel/gui
  copying ipykernel/gui/gtkembed.py -> build/lib/ipykernel/gui
  copying ipykernel/gui/__init__.py -> build/lib/ipykernel/gui
  copying ipykernel/gui/gtk3embed.py -> build/lib/ipykernel/gui
  creating build/lib/ipykernel/inprocess
  copying ipykernel/inprocess/channels.py -> build/lib/ipykernel/inprocess
  copying ipykernel/inprocess/__init__.py -> build/lib/ipykernel/inprocess
  copying ipykernel/inprocess/constants.py -> build/lib/ipykernel/inprocess
  copying ipykernel/inprocess/socket.py -> build/lib/ipykernel/inprocess
  copying ipykernel/inprocess/ipkernel.py -> build/lib/ipykernel/inprocess
  copying ipykernel/inprocess/client.py -> build/lib/ipykernel/inprocess
  copying ipykernel/inprocess/blocking.py -> build/lib/ipykernel/inprocess
  copying ipykernel/inprocess/manager.py -> build/lib/ipykernel/inprocess
  creating build/lib/ipykernel/inprocess/tests
  copying ipykernel/inprocess/tests/__init__.py -> build/lib/ipykernel/inprocess/tests
  copying ipykernel/inprocess/tests/test_kernel.py -> build/lib/ipykernel/inprocess/tests
  copying ipykernel/inprocess/tests/test_kernelmanager.py -> build/lib/ipykernel/inprocess/tests
  creating build/lib/ipykernel/resources
  copying ipykernel/resources/logo-64x64.png -> build/lib/ipykernel/resources
  copying ipykernel/resources/logo-32x32.png -> build/lib/ipykernel/resources
  installing to build/bdist.linux-x86_64/wheel
  running install
  running install_lib
  creating build/bdist.linux-x86_64
  creating build/bdist.linux-x86_64/wheel
  copying build/lib/ipykernel_launcher.py -> build/bdist.linux-x86_64/wheel
  creating build/bdist.linux-x86_64/wheel/ipykernel
  copying build/lib/ipykernel/pickleutil.py -> build/bdist.linux-x86_64/wheel/ipykernel
  copying build/lib/ipykernel/embed.py -> build/bdist.linux-x86_64/wheel/ipykernel
  copying build/lib/ipykernel/kernelapp.py -> build/bdist.linux-x86_64/wheel/ipykernel
  copying build/lib/ipykernel/jsonutil.py -> build/bdist.linux-x86_64/wheel/ipykernel
  copying build/lib/ipykernel/connect.py -> build/bdist.linux-x86_64/wheel/ipykernel
  copying build/lib/ipykernel/zmqshell.py -> build/bdist.linux-x86_64/wheel/ipykernel
  copying build/lib/ipykernel/iostream.py -> build/bdist.linux-x86_64/wheel/ipykernel
  copying build/lib/ipykernel/heartbeat.py -> build/bdist.linux-x86_64/wheel/ipykernel
  copying build/lib/ipykernel/kernelspec.py -> build/bdist.linux-x86_64/wheel/ipykernel
  copying build/lib/ipykernel/eventloops.py -> build/bdist.linux-x86_64/wheel/ipykernel
  copying build/lib/ipykernel/__init__.py -> build/bdist.linux-x86_64/wheel/ipykernel
  creating build/bdist.linux-x86_64/wheel/ipykernel/resources
  copying build/lib/ipykernel/resources/logo-64x64.png -> build/bdist.linux-x86_64/wheel/ipykernel/resources
  copying build/lib/ipykernel/resources/logo-32x32.png -> build/bdist.linux-x86_64/wheel/ipykernel/resources
  copying build/lib/ipykernel/_version.py -> build/bdist.linux-x86_64/wheel/ipykernel
  copying build/lib/ipykernel/_eventloop_macos.py -> build/bdist.linux-x86_64/wheel/ipykernel
  creating build/bdist.linux-x86_64/wheel/ipykernel/tests
  copying build/lib/ipykernel/tests/test_embed_kernel.py -> build/bdist.linux-x86_64/wheel/ipykernel/tests
  copying build/lib/ipykernel/tests/_asyncio_utils.py -> build/bdist.linux-x86_64/wheel/ipykernel/tests
  copying build/lib/ipykernel/tests/test_jsonutil.py -> build/bdist.linux-x86_64/wheel/ipykernel/tests
  copying build/lib/ipykernel/tests/test_connect.py -> build/bdist.linux-x86_64/wheel/ipykernel/tests
  copying build/lib/ipykernel/tests/test_eventloop.py -> build/bdist.linux-x86_64/wheel/ipykernel/tests
  copying build/lib/ipykernel/tests/test_heartbeat.py -> build/bdist.linux-x86_64/wheel/ipykernel/tests
  copying build/lib/ipykernel/tests/__init__.py -> build/bdist.linux-x86_64/wheel/ipykernel/tests
  copying build/lib/ipykernel/tests/test_zmq_shell.py -> build/bdist.linux-x86_64/wheel/ipykernel/tests
  copying build/lib/ipykernel/tests/test_serialize.py -> build/bdist.linux-x86_64/wheel/ipykernel/tests
  copying build/lib/ipykernel/tests/test_pickleutil.py -> build/bdist.linux-x86_64/wheel/ipykernel/tests
  copying build/lib/ipykernel/tests/test_async.py -> build/bdist.linux-x86_64/wheel/ipykernel/tests
  copying build/lib/ipykernel/tests/test_io.py -> build/bdist.linux-x86_64/wheel/ipykernel/tests
  copying build/lib/ipykernel/tests/utils.py -> build/bdist.linux-x86_64/wheel/ipykernel/tests
  copying build/lib/ipykernel/tests/test_start_kernel.py -> build/bdist.linux-x86_64/wheel/ipykernel/tests
  copying build/lib/ipykernel/tests/test_kernelspec.py -> build/bdist.linux-x86_64/wheel/ipykernel/tests
  copying build/lib/ipykernel/tests/test_message_spec.py -> build/bdist.linux-x86_64/wheel/ipykernel/tests
  copying build/lib/ipykernel/tests/test_kernel.py -> build/bdist.linux-x86_64/wheel/ipykernel/tests
  copying build/lib/ipykernel/ipkernel.py -> build/bdist.linux-x86_64/wheel/ipykernel
  creating build/bdist.linux-x86_64/wheel/ipykernel/pylab
  copying build/lib/ipykernel/pylab/backend_inline.py -> build/bdist.linux-x86_64/wheel/ipykernel/pylab
  copying build/lib/ipykernel/pylab/__init__.py -> build/bdist.linux-x86_64/wheel/ipykernel/pylab
  copying build/lib/ipykernel/pylab/config.py -> build/bdist.linux-x86_64/wheel/ipykernel/pylab
  copying build/lib/ipykernel/codeutil.py -> build/bdist.linux-x86_64/wheel/ipykernel
  copying build/lib/ipykernel/displayhook.py -> build/bdist.linux-x86_64/wheel/ipykernel
  copying build/lib/ipykernel/parentpoller.py -> build/bdist.linux-x86_64/wheel/ipykernel
  creating build/bdist.linux-x86_64/wheel/ipykernel/comm
  copying build/lib/ipykernel/comm/comm.py -> build/bdist.linux-x86_64/wheel/ipykernel/comm
  copying build/lib/ipykernel/comm/__init__.py -> build/bdist.linux-x86_64/wheel/ipykernel/comm
  copying build/lib/ipykernel/comm/manager.py -> build/bdist.linux-x86_64/wheel/ipykernel/comm
  creating build/bdist.linux-x86_64/wheel/ipykernel/gui
  copying build/lib/ipykernel/gui/gtkembed.py -> build/bdist.linux-x86_64/wheel/ipykernel/gui
  copying build/lib/ipykernel/gui/__init__.py -> build/bdist.linux-x86_64/wheel/ipykernel/gui
  copying build/lib/ipykernel/gui/gtk3embed.py -> build/bdist.linux-x86_64/wheel/ipykernel/gui
  copying build/lib/ipykernel/datapub.py -> build/bdist.linux-x86_64/wheel/ipykernel
  copying build/lib/ipykernel/serialize.py -> build/bdist.linux-x86_64/wheel/ipykernel
  copying build/lib/ipykernel/__main__.py -> build/bdist.linux-x86_64/wheel/ipykernel
  copying build/lib/ipykernel/kernelbase.py -> build/bdist.linux-x86_64/wheel/ipykernel
  creating build/bdist.linux-x86_64/wheel/ipykernel/inprocess
  copying build/lib/ipykernel/inprocess/channels.py -> build/bdist.linux-x86_64/wheel/ipykernel/inprocess
  copying build/lib/ipykernel/inprocess/__init__.py -> build/bdist.linux-x86_64/wheel/ipykernel/inprocess
  copying build/lib/ipykernel/inprocess/constants.py -> build/bdist.linux-x86_64/wheel/ipykernel/inprocess
  creating build/bdist.linux-x86_64/wheel/ipykernel/inprocess/tests
  copying build/lib/ipykernel/inprocess/tests/__init__.py -> build/bdist.linux-x86_64/wheel/ipykernel/inprocess/tests
  copying build/lib/ipykernel/inprocess/tests/test_kernel.py -> build/bdist.linux-x86_64/wheel/ipykernel/inprocess/tests
  copying build/lib/ipykernel/inprocess/tests/test_kernelmanager.py -> build/bdist.linux-x86_64/wheel/ipykernel/inprocess/tests
  copying build/lib/ipykernel/inprocess/socket.py -> build/bdist.linux-x86_64/wheel/ipykernel/inprocess
  copying build/lib/ipykernel/inprocess/ipkernel.py -> build/bdist.linux-x86_64/wheel/ipykernel/inprocess
  copying build/lib/ipykernel/inprocess/client.py -> build/bdist.linux-x86_64/wheel/ipykernel/inprocess
  copying build/lib/ipykernel/inprocess/blocking.py -> build/bdist.linux-x86_64/wheel/ipykernel/inprocess
  copying build/lib/ipykernel/inprocess/manager.py -> build/bdist.linux-x86_64/wheel/ipykernel/inprocess
  copying build/lib/ipykernel/log.py -> build/bdist.linux-x86_64/wheel/ipykernel
  running install_data
  creating build/bdist.linux-x86_64/wheel/ipykernel-5.1.3.data
  creating build/bdist.linux-x86_64/wheel/ipykernel-5.1.3.data/data
  creating build/bdist.linux-x86_64/wheel/ipykernel-5.1.3.data/data/share
  creating build/bdist.linux-x86_64/wheel/ipykernel-5.1.3.data/data/share/jupyter
  creating build/bdist.linux-x86_64/wheel/ipykernel-5.1.3.data/data/share/jupyter/kernels
  creating build/bdist.linux-x86_64/wheel/ipykernel-5.1.3.data/data/share/jupyter/kernels/python3
  copying data_kernelspec/kernel.json -> build/bdist.linux-x86_64/wheel/ipykernel-5.1.3.data/data/share/jupyter/kernels/python3
  copying data_kernelspec/logo-64x64.png -> build/bdist.linux-x86_64/wheel/ipykernel-5.1.3.data/data/share/jupyter/kernels/python3
  copying data_kernelspec/logo-32x32.png -> build/bdist.linux-x86_64/wheel/ipykernel-5.1.3.data/data/share/jupyter/kernels/python3
  running install_egg_info
  running egg_info
  writing ipykernel.egg-info/PKG-INFO
  writing dependency_links to ipykernel.egg-info/dependency_links.txt
  writing requirements to ipykernel.egg-info/requires.txt
  writing top-level names to ipykernel.egg-info/top_level.txt
  reading manifest file 'ipykernel.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  warning: no previously-included files found matching 'docs/#*'
  no previously-included directories found matching 'docs/_build'
  no previously-included directories found matching 'docs/gh-pages'
  no previously-included directories found matching 'docs/dist'
  warning: no previously-included files matching '*~' found anywhere in distribution
  warning: no previously-included files matching '*.pyc' found anywhere in distribution
  warning: no previously-included files matching '*.pyo' found anywhere in distribution
  warning: no previously-included files matching '.git' found anywhere in distribution
  warning: no previously-included files matching '.ipynb_checkpoints' found anywhere in distribution
  writing manifest file 'ipykernel.egg-info/SOURCES.txt'
  Copying ipykernel.egg-info to build/bdist.linux-x86_64/wheel/ipykernel-5.1.3-py3.7.egg-info
  running install_scripts
  creating build/bdist.linux-x86_64/wheel/ipykernel-5.1.3.dist-info/WHEEL
  creating '/tmp/pip-wheel-e37bh00v/tmprgupnmg6/ipykernel-5.1.3-py3-none-any.whl' and adding 'build/bdist.linux-x86_64/wheel' to it
  adding 'ipykernel_launcher.py'
  adding 'ipykernel/__init__.py'
  adding 'ipykernel/__main__.py'
  adding 'ipykernel/_eventloop_macos.py'
  adding 'ipykernel/_version.py'
  adding 'ipykernel/codeutil.py'
  adding 'ipykernel/connect.py'
  adding 'ipykernel/datapub.py'
  adding 'ipykernel/displayhook.py'
  adding 'ipykernel/embed.py'
  adding 'ipykernel/eventloops.py'
  adding 'ipykernel/heartbeat.py'
  adding 'ipykernel/iostream.py'
  adding 'ipykernel/ipkernel.py'
  adding 'ipykernel/jsonutil.py'
  adding 'ipykernel/kernelapp.py'
  adding 'ipykernel/kernelbase.py'
  adding 'ipykernel/kernelspec.py'
  adding 'ipykernel/log.py'
  adding 'ipykernel/parentpoller.py'
  adding 'ipykernel/pickleutil.py'
  adding 'ipykernel/serialize.py'
  adding 'ipykernel/zmqshell.py'
  adding 'ipykernel/comm/__init__.py'
  adding 'ipykernel/comm/comm.py'
  adding 'ipykernel/comm/manager.py'
  adding 'ipykernel/gui/__init__.py'
  adding 'ipykernel/gui/gtk3embed.py'
  adding 'ipykernel/gui/gtkembed.py'
  adding 'ipykernel/inprocess/__init__.py'
  adding 'ipykernel/inprocess/blocking.py'
  adding 'ipykernel/inprocess/channels.py'
  adding 'ipykernel/inprocess/client.py'
  adding 'ipykernel/inprocess/constants.py'
  adding 'ipykernel/inprocess/ipkernel.py'
  adding 'ipykernel/inprocess/manager.py'
  adding 'ipykernel/inprocess/socket.py'
  adding 'ipykernel/inprocess/tests/__init__.py'
  adding 'ipykernel/inprocess/tests/test_kernel.py'
  adding 'ipykernel/inprocess/tests/test_kernelmanager.py'
  adding 'ipykernel/pylab/__init__.py'
  adding 'ipykernel/pylab/backend_inline.py'
  adding 'ipykernel/pylab/config.py'
  adding 'ipykernel/resources/logo-32x32.png'
  adding 'ipykernel/resources/logo-64x64.png'
  adding 'ipykernel/tests/__init__.py'
  adding 'ipykernel/tests/_asyncio_utils.py'
  adding 'ipykernel/tests/test_async.py'
  adding 'ipykernel/tests/test_connect.py'
  adding 'ipykernel/tests/test_embed_kernel.py'
  adding 'ipykernel/tests/test_eventloop.py'
  adding 'ipykernel/tests/test_heartbeat.py'
  adding 'ipykernel/tests/test_io.py'
  adding 'ipykernel/tests/test_jsonutil.py'
  adding 'ipykernel/tests/test_kernel.py'
  adding 'ipykernel/tests/test_kernelspec.py'
  adding 'ipykernel/tests/test_message_spec.py'
  adding 'ipykernel/tests/test_pickleutil.py'
  adding 'ipykernel/tests/test_serialize.py'
  adding 'ipykernel/tests/test_start_kernel.py'
  adding 'ipykernel/tests/test_zmq_shell.py'
  adding 'ipykernel/tests/utils.py'
  adding 'ipykernel-5.1.3.data/data/share/jupyter/kernels/python3/kernel.json'
  adding 'ipykernel-5.1.3.data/data/share/jupyter/kernels/python3/logo-32x32.png'
  adding 'ipykernel-5.1.3.data/data/share/jupyter/kernels/python3/logo-64x64.png'
  adding 'ipykernel-5.1.3.dist-info/COPYING.md'
  adding 'ipykernel-5.1.3.dist-info/METADATA'
  adding 'ipykernel-5.1.3.dist-info/WHEEL'
  adding 'ipykernel-5.1.3.dist-info/top_level.txt'
  adding 'ipykernel-5.1.3.dist-info/RECORD'
  removing build/bdist.linux-x86_64/wheel
  Building wheel for ipykernel (PEP 517) ... done
  Created wheel for ipykernel: filename=ipykernel-5.1.3-cp37-none-any.whl size=116630 sha256=aacaaddb6aa7b4df755fed5a5f2815b94280fbe9be42abb20e6843324fbded32
  Stored in directory: /tmp/pip-ephem-wheel-cache-9ultri8d/wheels/20/bc/d0/f1c472216917c8d2cff51e28ea2ecd946f1e6db80ca018b373
  Removing source in /tmp/pip-req-build-spvcrne3
Successfully built ipykernel
Installing collected packages: ipykernel
  Found existing installation: ipykernel 5.1.3
    Uninstalling ipykernel-5.1.3:
      Created temporary directory: /tmp/pip-uninstall-lkz8k3ow
      Removing file or directory /home/sylvain/miniconda3/lib/python3.7/site-packages/__pycache__/ipykernel_launcher.cpython-37.pyc
      Created temporary directory: /home/sylvain/miniconda3/lib/python3.7/site-packages/~pykernel-5.1.3.dist-info
      Removing file or directory /home/sylvain/miniconda3/lib/python3.7/site-packages/ipykernel-5.1.3.dist-info/
      Created temporary directory: /home/sylvain/miniconda3/lib/python3.7/site-packages/~pykernel
      Removing file or directory /home/sylvain/miniconda3/lib/python3.7/site-packages/ipykernel/
      Created temporary directory: /tmp/pip-uninstall-hj19jpfh
      Removing file or directory /home/sylvain/miniconda3/lib/python3.7/site-packages/ipykernel_launcher.py
      Created temporary directory: /home/sylvain/miniconda3/share/jupyter/kernels/~ython3
      Removing file or directory /home/sylvain/miniconda3/share/jupyter/kernels/python3/
      Successfully uninstalled ipykernel-5.1.3

Successfully installed ipykernel-5.1.3
Cleaning up...
Removed build tracker '/tmp/pip-req-tracker-ofbi5z30'

@no-response no-response bot removed the S: awaiting response Waiting for a response/more information label Oct 21, 2019
@SylvainCorlay
Copy link
Author

Are you still having trouble reproducing the issue?

@chrahunt
Copy link
Member

I was able to reproduce in a container

repro.sh
repro.sh
#!/bin/sh

docker run python:3.7.3 bash -c '
git clone https://github.com/ipython/ipykernel.git
cd ipykernel
python -m venv env
env/bin/python -m pip install pip==19.1.1 wheel

echo - Should not build wheel -------------------------------------------------
env/bin/python -m pip install --no-binary :all: --no-build-isolation .

echo - Should build wheel -----------------------------------------------------
env/bin/python -m pip install .

env/bin/python -m pip install --upgrade pip

echo - Should not build wheel -------------------------------------------------
env/bin/python -m pip install --no-binary :all: --no-build-isolation .

echo - Should build wheel -----------------------------------------------------
env/bin/python -m pip install .
'

With output

Output
Cloning into 'ipykernel'...
Collecting pip==19.1.1
  Downloading https://files.pythonhosted.org/packages/5c/e0/be401c003291b56efc55aeba6a80ab790d3d4cece2778288d65323009420/pip-19.1.1-py2.py3-none-any.whl (1.4MB)
Collecting wheel
  Downloading https://files.pythonhosted.org/packages/00/83/b4a77d044e78ad1a45610eb88f745be2fd2c6d658f9798a15e384b7d57c9/wheel-0.33.6-py2.py3-none-any.whl
Installing collected packages: pip, wheel
  Found existing installation: pip 19.0.3
    Uninstalling pip-19.0.3:
      Successfully uninstalled pip-19.0.3
Successfully installed pip-19.1.1 wheel-0.33.6
- Should not build wheel -------------------------------------------------
Processing /ipykernel
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'done'
Collecting traitlets>=4.1.0 (from ipykernel==5.2.0.dev0)
  Downloading https://files.pythonhosted.org/packages/75/b0/43deb021bc943f18f07cbe3dac1d681626a48997b7ffa1e7fb14ef922b21/traitlets-4.3.3.tar.gz (89kB)
Collecting tornado>=4.2 (from ipykernel==5.2.0.dev0)
  Downloading https://files.pythonhosted.org/packages/30/78/2d2823598496127b21423baffaa186b668f73cd91887fcef78b6eade136b/tornado-6.0.3.tar.gz (482kB)
Collecting ipython>=5.0.0 (from ipykernel==5.2.0.dev0)
  Downloading https://files.pythonhosted.org/packages/89/60/acb98588d8eba96558e69d90fa54f9908b4e48f6492ff378697f0c2216e2/ipython-7.8.0.tar.gz (5.2MB)
Collecting jupyter-client (from ipykernel==5.2.0.dev0)
  Downloading https://files.pythonhosted.org/packages/c4/cf/ccd7bc6935b60fe4470d7c209e4edde5e18058938f6e81aa0e9db5578c54/jupyter_client-5.3.4.tar.gz (275kB)
Collecting ipython_genutils (from traitlets>=4.1.0->ipykernel==5.2.0.dev0)
  Downloading https://files.pythonhosted.org/packages/e8/69/fbeffffc05236398ebfcfb512b6d2511c622871dca1746361006da310399/ipython_genutils-0.2.0.tar.gz
Collecting six (from traitlets>=4.1.0->ipykernel==5.2.0.dev0)
  Downloading https://files.pythonhosted.org/packages/dd/bf/4138e7bfb757de47d1f4b6994648ec67a51efe58fa907c1e11e350cddfca/six-1.12.0.tar.gz
Collecting decorator (from traitlets>=4.1.0->ipykernel==5.2.0.dev0)
  Downloading https://files.pythonhosted.org/packages/ba/19/1119fe7b1e49b9c8a9f154c930060f37074ea2e8f9f6558efc2eeaa417a2/decorator-4.4.0.tar.gz
Requirement already satisfied: setuptools>=18.5 in ./env/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel==5.2.0.dev0) (40.8.0)
Collecting jedi>=0.10 (from ipython>=5.0.0->ipykernel==5.2.0.dev0)
  Downloading https://files.pythonhosted.org/packages/85/03/cd5a6e44a5753b4d539288d9d1f9645caac889c17dd2950292a8818f86b2/jedi-0.15.1.tar.gz (872kB)
Collecting pickleshare (from ipython>=5.0.0->ipykernel==5.2.0.dev0)
  Downloading https://files.pythonhosted.org/packages/d8/b6/df3c1c9b616e9c0edbc4fbab6ddd09df9535849c64ba51fcb6531c32d4d8/pickleshare-0.7.5.tar.gz
Collecting prompt_toolkit<2.1.0,>=2.0.0 (from ipython>=5.0.0->ipykernel==5.2.0.dev0)
  Downloading https://files.pythonhosted.org/packages/0c/37/7ad3bf3c6dbe96facf9927ddf066fdafa0f86766237cff32c3c7355d3b7c/prompt_toolkit-2.0.10.tar.gz (347kB)
Collecting pygments (from ipython>=5.0.0->ipykernel==5.2.0.dev0)
  Downloading https://files.pythonhosted.org/packages/7e/ae/26808275fc76bf2832deb10d3a3ed3107bc4de01b85dcccbe525f2cd6d1e/Pygments-2.4.2.tar.gz (9.4MB)
Collecting backcall (from ipython>=5.0.0->ipykernel==5.2.0.dev0)
  Downloading https://files.pythonhosted.org/packages/84/71/c8ca4f5bb1e08401b916c68003acf0a0655df935d74d93bf3f3364b310e0/backcall-0.1.0.tar.gz
Collecting pexpect (from ipython>=5.0.0->ipykernel==5.2.0.dev0)
  Downloading https://files.pythonhosted.org/packages/1c/b1/362a0d4235496cb42c33d1d8732b5e2c607b0129ad5fdd76f5a583b9fcb3/pexpect-4.7.0.tar.gz (153kB)
Collecting jupyter_core>=4.6.0 (from jupyter-client->ipykernel==5.2.0.dev0)
  Downloading https://files.pythonhosted.org/packages/a4/47/e852cd00ae811939201b7f8118a856f2c6a52db3b31c4185ffbc098405c7/jupyter_core-4.6.0.tar.gz (64kB)
Collecting pyzmq>=13 (from jupyter-client->ipykernel==5.2.0.dev0)
  Downloading https://files.pythonhosted.org/packages/7a/d2/1eb3a994374802b352d4911f3317313a5b4ea786bc830cc5e343dad9b06d/pyzmq-18.1.0.tar.gz (1.2MB)
Collecting python-dateutil>=2.1 (from jupyter-client->ipykernel==5.2.0.dev0)
  Downloading https://files.pythonhosted.org/packages/ad/99/5b2e99737edeb28c71bcbec5b5dda19d0d9ef3ca3e92e3e925e7c0bb364c/python-dateutil-2.8.0.tar.gz (327kB)
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'done'
Collecting parso>=0.5.0 (from jedi>=0.10->ipython>=5.0.0->ipykernel==5.2.0.dev0)
  Downloading https://files.pythonhosted.org/packages/21/40/615957db4d178b7504c87b1a5b85fa5945b0b4fa5f5a845e31fc7aad6018/parso-0.5.1.tar.gz (391kB)
Collecting wcwidth (from prompt_toolkit<2.1.0,>=2.0.0->ipython>=5.0.0->ipykernel==5.2.0.dev0)
  Downloading https://files.pythonhosted.org/packages/55/11/e4a2bb08bb450fdbd42cc709dd40de4ed2c472cf0ccb9e64af22279c5495/wcwidth-0.1.7.tar.gz
Collecting ptyprocess>=0.5 (from pexpect->ipython>=5.0.0->ipykernel==5.2.0.dev0)
  Downloading https://files.pythonhosted.org/packages/7d/2d/e4b8733cf79b7309d84c9081a4ab558c89d8c89da5961bf4ddb050ca1ce0/ptyprocess-0.6.0.tar.gz (70kB)
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'done'
ERROR: Exception:
Traceback (most recent call last):
  File "/ipykernel/env/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 178, in main
    status = self.run(options, args)
  File "/ipykernel/env/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 352, in run
    resolver.resolve(requirement_set)
  File "/ipykernel/env/lib/python3.7/site-packages/pip/_internal/resolve.py", line 131, in resolve
    self._resolve_one(requirement_set, req)
  File "/ipykernel/env/lib/python3.7/site-packages/pip/_internal/resolve.py", line 294, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/ipykernel/env/lib/python3.7/site-packages/pip/_internal/resolve.py", line 242, in _get_abstract_dist_for
    self.require_hashes
  File "/ipykernel/env/lib/python3.7/site-packages/pip/_internal/operations/prepare.py", line 362, in prepare_linked_requirement
    abstract_dist.prep_for_dist(finder, self.build_isolation)
  File "/ipykernel/env/lib/python3.7/site-packages/pip/_internal/operations/prepare.py", line 171, in prep_for_dist
    self.req.prepare_metadata()
  File "/ipykernel/env/lib/python3.7/site-packages/pip/_internal/req/req_install.py", line 535, in prepare_metadata
    self.prepare_pep517_metadata()
  File "/ipykernel/env/lib/python3.7/site-packages/pip/_internal/req/req_install.py", line 580, in prepare_pep517_metadata
    metadata_dir
  File "/ipykernel/env/lib/python3.7/site-packages/pip/_vendor/pep517/wrappers.py", line 86, in prepare_metadata_for_build_wheel
    'config_settings': config_settings,
  File "/ipykernel/env/lib/python3.7/site-packages/pip/_vendor/pep517/wrappers.py", line 162, in _call_hook
    raise BackendUnavailable
pip._vendor.pep517.wrappers.BackendUnavailable
WARNING: You are using pip version 19.1.1, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
- Should build wheel -----------------------------------------------------
Processing /ipykernel
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'done'
Collecting ipython>=5.0.0 (from ipykernel==5.2.0.dev0)
  Using cached https://files.pythonhosted.org/packages/fb/44/f28a13852e562af719f9de1761680a84a93e8b4c50e22d00d68f60ee2e8b/ipython-7.8.0-py3-none-any.whl
Collecting tornado>=4.2 (from ipykernel==5.2.0.dev0)
Collecting jupyter-client (from ipykernel==5.2.0.dev0)
  Using cached https://files.pythonhosted.org/packages/13/81/fe0eee1bcf949851a120254b1f530ae1e01bdde2d3ab9710c6ff81525061/jupyter_client-5.3.4-py2.py3-none-any.whl
Collecting traitlets>=4.1.0 (from ipykernel==5.2.0.dev0)
  Using cached https://files.pythonhosted.org/packages/ca/ab/872a23e29cec3cf2594af7e857f18b687ad21039c1f9b922fac5b9b142d5/traitlets-4.3.3-py2.py3-none-any.whl
Collecting pygments (from ipython>=5.0.0->ipykernel==5.2.0.dev0)
  Using cached https://files.pythonhosted.org/packages/5c/73/1dfa428150e3ccb0fa3e68db406e5be48698f2a979ccbcec795f28f44048/Pygments-2.4.2-py2.py3-none-any.whl
Collecting pexpect; sys_platform != "win32" (from ipython>=5.0.0->ipykernel==5.2.0.dev0)
  Using cached https://files.pythonhosted.org/packages/0e/3e/377007e3f36ec42f1b84ec322ee12141a9e10d808312e5738f52f80a232c/pexpect-4.7.0-py2.py3-none-any.whl
Collecting decorator (from ipython>=5.0.0->ipykernel==5.2.0.dev0)
  Using cached https://files.pythonhosted.org/packages/5f/88/0075e461560a1e750a0dcbf77f1d9de775028c37a19a346a6c565a257399/decorator-4.4.0-py2.py3-none-any.whl
Requirement already satisfied: setuptools>=18.5 in ./env/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel==5.2.0.dev0) (40.8.0)
Collecting pickleshare (from ipython>=5.0.0->ipykernel==5.2.0.dev0)
  Using cached https://files.pythonhosted.org/packages/9a/41/220f49aaea88bc6fa6cba8d05ecf24676326156c23b991e80b3f2fc24c77/pickleshare-0.7.5-py2.py3-none-any.whl
Collecting jedi>=0.10 (from ipython>=5.0.0->ipykernel==5.2.0.dev0)
  Using cached https://files.pythonhosted.org/packages/55/54/da994f359e4e7da4776a200e76dbc85ba5fc319eefc22e33d55296d95a1d/jedi-0.15.1-py2.py3-none-any.whl
Collecting backcall (from ipython>=5.0.0->ipykernel==5.2.0.dev0)
Collecting prompt-toolkit<2.1.0,>=2.0.0 (from ipython>=5.0.0->ipykernel==5.2.0.dev0)
  Using cached https://files.pythonhosted.org/packages/87/61/2dfea88583d5454e3a64f9308a686071d58d59a55db638268a6413e1eb6d/prompt_toolkit-2.0.10-py3-none-any.whl
Collecting pyzmq>=13 (from jupyter-client->ipykernel==5.2.0.dev0)
  Using cached https://files.pythonhosted.org/packages/c7/6a/307e4a576787c7df1df6ebf56754c3fc8defcafa1a09ee22e9b961a390be/pyzmq-18.1.0-cp37-cp37m-manylinux1_x86_64.whl
Collecting python-dateutil>=2.1 (from jupyter-client->ipykernel==5.2.0.dev0)
  Using cached https://files.pythonhosted.org/packages/41/17/c62faccbfbd163c7f57f3844689e3a78bae1f403648a6afb1d0866d87fbb/python_dateutil-2.8.0-py2.py3-none-any.whl
Collecting jupyter-core>=4.6.0 (from jupyter-client->ipykernel==5.2.0.dev0)
  Using cached https://files.pythonhosted.org/packages/56/a6/fe4b7029d4994870df6685bdc7bae5417bea30b627c4ce36106f9cac31fc/jupyter_core-4.6.0-py2.py3-none-any.whl
Collecting ipython-genutils (from traitlets>=4.1.0->ipykernel==5.2.0.dev0)
  Using cached https://files.pythonhosted.org/packages/fa/bc/9bd3b5c2b4774d5f33b2d544f1460be9df7df2fe42f352135381c347c69a/ipython_genutils-0.2.0-py2.py3-none-any.whl
Collecting six (from traitlets>=4.1.0->ipykernel==5.2.0.dev0)
  Using cached https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting ptyprocess>=0.5 (from pexpect; sys_platform != "win32"->ipython>=5.0.0->ipykernel==5.2.0.dev0)
  Using cached https://files.pythonhosted.org/packages/d1/29/605c2cc68a9992d18dada28206eeada56ea4bd07a239669da41674648b6f/ptyprocess-0.6.0-py2.py3-none-any.whl
Collecting parso>=0.5.0 (from jedi>=0.10->ipython>=5.0.0->ipykernel==5.2.0.dev0)
  Using cached https://files.pythonhosted.org/packages/a3/bd/bf4e5bd01d79906e5b945a7af033154da49fd2b0d5b5c705a21330323305/parso-0.5.1-py2.py3-none-any.whl
Collecting wcwidth (from prompt-toolkit<2.1.0,>=2.0.0->ipython>=5.0.0->ipykernel==5.2.0.dev0)
  Using cached https://files.pythonhosted.org/packages/7e/9f/526a6947247599b084ee5232e4f9190a38f398d7300d866af3ab571a5bfe/wcwidth-0.1.7-py2.py3-none-any.whl
Building wheels for collected packages: ipykernel
  Building wheel for ipykernel (PEP 517): started
  Building wheel for ipykernel (PEP 517): finished with status 'done'
  Stored in directory: /tmp/pip-ephem-wheel-cache-0zo13z41/wheels/3d/97/9a/ab094d6d25eeb60c0279e5f2c7180d8ed9e49ef26473e465fe
Successfully built ipykernel
Installing collected packages: pygments, ptyprocess, pexpect, decorator, pickleshare, parso, jedi, backcall, wcwidth, six, prompt-toolkit, ipython-genutils, traitlets, ipython, tornado, pyzmq, python-dateutil, jupyter-core, jupyter-client, ipykernel
Successfully installed backcall-0.1.0 decorator-4.4.0 ipykernel-5.2.0.dev0 ipython-7.8.0 ipython-genutils-0.2.0 jedi-0.15.1 jupyter-client-5.3.4 jupyter-core-4.6.0 parso-0.5.1 pexpect-4.7.0 pickleshare-0.7.5 prompt-toolkit-2.0.10 ptyprocess-0.6.0 pygments-2.4.2 python-dateutil-2.8.0 pyzmq-18.1.0 six-1.12.0 tornado-6.0.3 traitlets-4.3.3 wcwidth-0.1.7
WARNING: You are using pip version 19.1.1, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting pip
  Downloading https://files.pythonhosted.org/packages/00/b6/9cfa56b4081ad13874b0c6f96af8ce16cfbc1cb06bedf8e9164ce5551ec1/pip-19.3.1-py2.py3-none-any.whl (1.4MB)
Installing collected packages: pip
  Found existing installation: pip 19.1.1
    Uninstalling pip-19.1.1:
      Successfully uninstalled pip-19.1.1
Successfully installed pip-19.3.1
- Should not build wheel -------------------------------------------------
Processing /ipykernel
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'done'
Requirement already satisfied: ipython>=5.0.0 in ./env/lib/python3.7/site-packages (from ipykernel==5.2.0.dev0) (7.8.0)
Requirement already satisfied: tornado>=4.2 in ./env/lib/python3.7/site-packages (from ipykernel==5.2.0.dev0) (6.0.3)
Requirement already satisfied: traitlets>=4.1.0 in ./env/lib/python3.7/site-packages (from ipykernel==5.2.0.dev0) (4.3.3)
Requirement already satisfied: jupyter-client in ./env/lib/python3.7/site-packages (from ipykernel==5.2.0.dev0) (5.3.4)
Requirement already satisfied: prompt-toolkit<2.1.0,>=2.0.0 in ./env/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel==5.2.0.dev0) (2.0.10)
Requirement already satisfied: pexpect; sys_platform != "win32" in ./env/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel==5.2.0.dev0) (4.7.0)
Requirement already satisfied: setuptools>=18.5 in ./env/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel==5.2.0.dev0) (40.8.0)
Requirement already satisfied: pygments in ./env/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel==5.2.0.dev0) (2.4.2)
Requirement already satisfied: decorator in ./env/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel==5.2.0.dev0) (4.4.0)
Requirement already satisfied: jedi>=0.10 in ./env/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel==5.2.0.dev0) (0.15.1)
Requirement already satisfied: backcall in ./env/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel==5.2.0.dev0) (0.1.0)
Requirement already satisfied: pickleshare in ./env/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel==5.2.0.dev0) (0.7.5)
Requirement already satisfied: ipython-genutils in ./env/lib/python3.7/site-packages (from traitlets>=4.1.0->ipykernel==5.2.0.dev0) (0.2.0)
Requirement already satisfied: six in ./env/lib/python3.7/site-packages (from traitlets>=4.1.0->ipykernel==5.2.0.dev0) (1.12.0)
Requirement already satisfied: jupyter-core>=4.6.0 in ./env/lib/python3.7/site-packages (from jupyter-client->ipykernel==5.2.0.dev0) (4.6.0)
Requirement already satisfied: python-dateutil>=2.1 in ./env/lib/python3.7/site-packages (from jupyter-client->ipykernel==5.2.0.dev0) (2.8.0)
Requirement already satisfied: pyzmq>=13 in ./env/lib/python3.7/site-packages (from jupyter-client->ipykernel==5.2.0.dev0) (18.1.0)
Requirement already satisfied: wcwidth in ./env/lib/python3.7/site-packages (from prompt-toolkit<2.1.0,>=2.0.0->ipython>=5.0.0->ipykernel==5.2.0.dev0) (0.1.7)
Requirement already satisfied: ptyprocess>=0.5 in ./env/lib/python3.7/site-packages (from pexpect; sys_platform != "win32"->ipython>=5.0.0->ipykernel==5.2.0.dev0) (0.6.0)
Requirement already satisfied: parso>=0.5.0 in ./env/lib/python3.7/site-packages (from jedi>=0.10->ipython>=5.0.0->ipykernel==5.2.0.dev0) (0.5.1)
Building wheels for collected packages: ipykernel
  Building wheel for ipykernel (PEP 517): started
  Building wheel for ipykernel (PEP 517): finished with status 'done'
  Created wheel for ipykernel: filename=ipykernel-5.2.0.dev0-cp37-none-any.whl size=116716 sha256=44bd63e4c22bd5dbabeca9c278d5a45a31b43a7f3c4355fc92d911bb5af63f1c
  Stored in directory: /tmp/pip-ephem-wheel-cache-9rdxfw2c/wheels/3d/97/9a/ab094d6d25eeb60c0279e5f2c7180d8ed9e49ef26473e465fe
Successfully built ipykernel
Installing collected packages: ipykernel
  Found existing installation: ipykernel 5.2.0.dev0
    Uninstalling ipykernel-5.2.0.dev0:
      Successfully uninstalled ipykernel-5.2.0.dev0
Successfully installed ipykernel-5.2.0.dev0
- Should build wheel -----------------------------------------------------
Processing /ipykernel
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'done'
Requirement already satisfied: traitlets>=4.1.0 in ./env/lib/python3.7/site-packages (from ipykernel==5.2.0.dev0) (4.3.3)
Requirement already satisfied: ipython>=5.0.0 in ./env/lib/python3.7/site-packages (from ipykernel==5.2.0.dev0) (7.8.0)
Requirement already satisfied: tornado>=4.2 in ./env/lib/python3.7/site-packages (from ipykernel==5.2.0.dev0) (6.0.3)
Requirement already satisfied: jupyter-client in ./env/lib/python3.7/site-packages (from ipykernel==5.2.0.dev0) (5.3.4)
Requirement already satisfied: decorator in ./env/lib/python3.7/site-packages (from traitlets>=4.1.0->ipykernel==5.2.0.dev0) (4.4.0)
Requirement already satisfied: ipython-genutils in ./env/lib/python3.7/site-packages (from traitlets>=4.1.0->ipykernel==5.2.0.dev0) (0.2.0)
Requirement already satisfied: six in ./env/lib/python3.7/site-packages (from traitlets>=4.1.0->ipykernel==5.2.0.dev0) (1.12.0)
Requirement already satisfied: pickleshare in ./env/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel==5.2.0.dev0) (0.7.5)
Requirement already satisfied: jedi>=0.10 in ./env/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel==5.2.0.dev0) (0.15.1)
Requirement already satisfied: pygments in ./env/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel==5.2.0.dev0) (2.4.2)
Requirement already satisfied: setuptools>=18.5 in ./env/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel==5.2.0.dev0) (40.8.0)
Requirement already satisfied: prompt-toolkit<2.1.0,>=2.0.0 in ./env/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel==5.2.0.dev0) (2.0.10)
Requirement already satisfied: backcall in ./env/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel==5.2.0.dev0) (0.1.0)
Requirement already satisfied: pexpect; sys_platform != "win32" in ./env/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel==5.2.0.dev0) (4.7.0)
Requirement already satisfied: jupyter-core>=4.6.0 in ./env/lib/python3.7/site-packages (from jupyter-client->ipykernel==5.2.0.dev0) (4.6.0)
Requirement already satisfied: pyzmq>=13 in ./env/lib/python3.7/site-packages (from jupyter-client->ipykernel==5.2.0.dev0) (18.1.0)
Requirement already satisfied: python-dateutil>=2.1 in ./env/lib/python3.7/site-packages (from jupyter-client->ipykernel==5.2.0.dev0) (2.8.0)
Requirement already satisfied: parso>=0.5.0 in ./env/lib/python3.7/site-packages (from jedi>=0.10->ipython>=5.0.0->ipykernel==5.2.0.dev0) (0.5.1)
Requirement already satisfied: wcwidth in ./env/lib/python3.7/site-packages (from prompt-toolkit<2.1.0,>=2.0.0->ipython>=5.0.0->ipykernel==5.2.0.dev0) (0.1.7)
Requirement already satisfied: ptyprocess>=0.5 in ./env/lib/python3.7/site-packages (from pexpect; sys_platform != "win32"->ipython>=5.0.0->ipykernel==5.2.0.dev0) (0.6.0)
Building wheels for collected packages: ipykernel
  Building wheel for ipykernel (PEP 517): started
  Building wheel for ipykernel (PEP 517): finished with status 'done'
  Created wheel for ipykernel: filename=ipykernel-5.2.0.dev0-cp37-none-any.whl size=116716 sha256=a5db9724abedeee694b65983c052921ff6f614cd63f57d0f91d2912614ea47ff
  Stored in directory: /tmp/pip-ephem-wheel-cache-mzhco7gn/wheels/3d/97/9a/ab094d6d25eeb60c0279e5f2c7180d8ed9e49ef26473e465fe
Successfully built ipykernel
Installing collected packages: ipykernel
  Found existing installation: ipykernel 5.2.0.dev0
    Uninstalling ipykernel-5.2.0.dev0:
      Successfully uninstalled ipykernel-5.2.0.dev0
Successfully installed ipykernel-5.2.0.dev0

With the latest version of pip (19.3.1) it builds a wheel in both cases, but I think this is the expected behavior. There are two relevant things to note here:

  1. The --no-binary option is interpreted to mean that we won't download wheels, but not that we won't build a wheel as part of installing the project. This is required because for projects using PEP 517, there is no other way to install them except by building a wheel. See #6222 (comment). PEP 517 itself states that we can implicitly assume a build-backend of setuptools.build_meta:__legacy__ if there's no build backend or pyproject.toml, so technically everything could be considered to use PEP 517 (but technically right now we only apply this to projects using pyproject.toml IIRC). We try that and then if the wheel build fails then we should be falling back to running setup.py.
  2. PEP 517/518 support was implemented without acknowledging the inherent conflict with the --no-binary option - this is what broke the original build from source of ipykernel because flit was unable to be built from source - this is now fixed (Fix PEP 517 builds for packages without setup.py #6606) so if you upgrade to 19.3.1 then you do not need the --no-build-isolation flag.

Can I ask what the use case is for not doing a wheel build?

@pradyunsg
Copy link
Member

Ah, --no-binary does not stand for “don’t build a wheel”, but rather that “don’t use wheels from the index”.

In PEP 517 (the build interface for that flit is implementing), the main way for flit and pip to communicate is via building wheels for installation on this machine.

@SylvainCorlay does that make the situation clearer? Do you have any suggestions on how we should communicate this to the end user?

@SylvainCorlay
Copy link
Author

SylvainCorlay commented Nov 22, 2019

  1. The --no-binary option is interpreted to mean that we won't download wheels, but not that we won't build a wheel as part of installing the project. This is required because for projects using PEP 517, there is no other way to install them except by building a wheel. See #6222 (comment). PEP 517 itself states that we can implicitly assume a build-backend of setuptools.build_meta:__legacy__ if there's no build backend or pyproject.toml, so technically everything could be considered to use PEP 517 (but technically right now we only apply this to projects using pyproject.toml IIRC). We try that and then if the wheel build fails then we should be falling back to running setup.py.
  2. PEP 517/518 support was implemented without acknowledging the inherent conflict with the --no-binary option - this is what broke the original build from source of ipykernel because flit was unable to be built from source - this is now fixed (Fix PEP 517 builds for packages without setup.py #6606) so if you upgrade to 19.3.1 then you do not need the --no-build-isolation flag.

Can I ask what the use case is for not doing a wheel build?

My usecase is that I use pip to build python packages as part of the build process for conda packages.

  • using --no-build-isolation is absolutely required in that context, as it was discussed in Add flag to disable build isolation #5033. Conda packages must be built in an environment of conda packages (we also use --no-deps) where all dependencies are installed as conda packages.
    This is probably also going to be the case for other package managers such as dpkg. This is especially important when the pypi flavor of the packages vendor their binary dependencies (like e.g. pyzmq) while the corresponding conda package will simply depend on the libzmq package.

  • for the same usecase, I also need to be able to prevent building wheels as part of the package installation, and trully install from source, (which seems possible at the moment when downloading a source package but not when building locally for some reason).
    The motivation is that when not building a wheel, the installation can take advantage of the knowledge of the full path to the prefix, while when building a wheel, it is not the case since python wheels don't have relocation features.

Ah, --no-binary does not stand for “don’t build a wheel”, but rather that “don’t use wheels from the index”.

In PEP 517 (the build interface for that flit is implementing), the main way for flit and pip to communicate is via building wheels for installation on this machine.

I think that it is very important that we retain the possibility of installing package from source without building a wheel for the usecase of package managers.

cc @isuruf @jakirkham

@chrahunt
Copy link
Member

I have a bunch of questions, please bear with me.

My usecase is that I use pip to build python packages as part of the build process for conda packages.

  • What is a "python package" here?
  • Which part of the build process for building conda packages requires building Python packages?
  • What is the role of the Python packages that are built? Are they meant to be deployed as conda packages themselves so they can be used as runtime dependencies for the conda package?
  • Can you point me to a repo that contains the necessary files so I could build a conda package that needs to build python packages as part of its build?
  • Is the Conda Package Specification here a valid description of the output of the conda package build process you're referring to?
  • Why is pip used to build the Python packages, instead of another tool?

I'll wait for those answers before diving into the rest of your comment, since they will probably provide a lot of the required context.

@isuruf
Copy link

isuruf commented Nov 24, 2019

I think that it is very important that we retain the possibility of installing package from source without building a wheel for the usecase of package managers.

For conda at least, it's fine if pip built a wheel and installed it. For conda, all we need is a way to use the packages in an existing environment and not use wheels from PyPI. This is what no-build-isolation does if my understanding is correct.

@SylvainCorlay
Copy link
Author

I have a bunch of questions, please bear with me.

I'll wait for those answers before diving into the rest of your comment, since they will probably provide a lot of the required context.

conda is a general-purpose package manager (not just for Python), and it builds packages (python packages or not) by creating a new environment (a prefix) in which dependencies are installed by conda and running the installation procedure from source in that environment.

For a C++ package built with e.g. cmake, that naturally involves running cmake and make, for a Python package, that generally implies invoking the setup.py through a pip install --no-deps --no-build-isolation .. In the end, the files that were added in that environment are bundled into a single package tarball (following the spec that you pointed to). Hence building a Python package means generating a conda package by running the installation into that environment.

In any case, as pointed out in earlier comments, for the usecase of conda (and I presume for other package managers as well):

  • It is important that we can use the --no-build-isolation command.
  • For certain packages, building wheels as part of the build process is ok, but in other cases not. The reason is that wheels don't have relocations capabilities (such as replacing the prefix with the actual value upon installation in text data files). This is an issue for e.g. ipykernel.

@pradyunsg pradyunsg added the S: needs triage Issues/PRs that need to be triaged label Feb 6, 2020
@SylvainCorlay
Copy link
Author

I'll wait for those answers before diving into the rest of your comment, since they will probably provide a lot of the required context.

@chrahunt I am following up on this.

Note: this issue will be important to most people working on packaging python packages for other package managers such as conda, apt-get etc...

@SylvainCorlay
Copy link
Author

For conda at least, it's fine if pip built a wheel and installed it. For conda, all we need is a way to use the packages in an existing environment and not use wheels from PyPI. This is what no-build-isolation does if my understanding is correct.

@isuruf actually I would like to build a conda package without building an intermediary wheel.

@chrahunt
Copy link
Member

@SylvainCorlay, to start, here is my understanding:

  1. There are Python packages that exist as wheels and source distributions in PyPI. Python packages are defined according to PEP 517 (for source distributions) and PEP 427 for wheels.
  2. Conda packages are defined according to this spec.
  3. "building a Conda package" means executing a Conda recipe. The Conda recipe should do something and produce the Conda package.
  4. When building a Conda package, it is a requirement that any dependencies used as part of the build of the Conda package are managed by Conda. This is important for several reasons, like ensuring binary compatibility (so the build-time headers match the runtime library, for example), reproducibility, and so the recipes are portable and only depend on the bare minimum, like /bin/sh.
  5. Because wheels that exist in PyPI could have been generated any number of ways, we don't want to use wheels from PyPI as the input to our Conda package build. Instead we want to generate packages from source distributions.
  6. Currently pip (pip install specifically) is used as a step in some Conda recipes because it knows how to "transform" a source distribution into files on disk laid out pretty close to how they should be laid out in the Conda package.
  7. pip by default has a "build isolation" feature that will create a temporary build environment (a temporary directory into which packages are installed and made available to a Python sub-process). Because we want Conda managing all of our build-time dependencies we disable this feature with --no-build-isolation. As a result, pip does not create a temporary build environment or alter the visible Python packages when "transforming" the source distribution.
  8. pip by default will also try to install dependencies for packages. We don't want that because our existing Conda build environment should be handling all required dependencies, so we disable this feature with --no-deps. As a result, pip just downloads and "transforms" the source distribution for the specific package we request, and none of its dependencies.
  9. Conda packages can take advantage of Conda's "prefix replacement" support documented here to support being relocatable, meaning that they can be installed to any path at runtime and work because anywhere in code where they need the runtime prefix they put a dummy path which will be replaced with the real one.
  10. We must be able to install Python packages from source distributions without creating intermediate wheels because when an intermediate wheel is created it breaks the "prefix replacement". I'm assuming (since I haven't seen an example of a Conda recipe that is breaking) that in the pip install command we provide a --prefix=/tmp/placeholder_placeholder_placeholder... so that when setup.py install is executed that's the directory embedded into the files and that doesn't work when we're doing intermediate wheel builds.

If that's all right, then I can provide the following guidance:

  1. No one is trying to change --no-build-isolation, please ignore my mention of it above, I had completely misunderstood the reason for using it here.

  2. pip cannot prevent creation of intermediate wheels, because in the general case the "transformation" of a Python source distribution into files on disk may only have 1 approach: pip builds the source distribution into a wheel and then installs the wheel into the environment. This is a fact of Python packaging as defined in PEP 517 and not specific to pip.

  3. The process of generating intermediate wheel files is completely in the control of the individual source distributions. When building a wheel, pip calls either:

    1. setup.py bdist_wheel, where the setup.py is the one provided by the source distribution or
    2. the build-backend defined in the pyproject.toml from the source distribution

    If the wheel files get generated and installed by pip as part of the Conda package build and the files on disk do not look the way that we (as Conda package creators) expect, that isn't a pip problem, it's a problem with the package or with our expectations.

  4. There are a few options for making the installed packages on disk look how we need them to look for the Conda package:

    1. Work with the individual package maintainers to get them to generate special wheels where the files that need a prefix use a special value you define. The "config settings" feature mentioned in Config settings support in PEP 517 #5771 would be required for the wheel build to distinguish a "normal" wheel build from a "Conda package recipe build" wheel build or you could use environment variables.
    2. Work with the individual package maintainers to reduce or eliminate cases where a literal prefix path is needed
    3. In the Conda recipe have a post-processing step that makes the "installed" files look the way we want for the Conda package, using specific rules for each package or general heuristics
    4. Work with the Python community to define a "prefix replacement" capability as part of the wheel standard, then work with the individual package maintainers to use it where it would be needed as part of Conda packages

@SylvainCorlay
Copy link
Author

Thanks for your detailed answer @chrahunt. I think we have a good understanding.

No one is trying to change --no-build-isolation, please ignore my mention of it above, I had completely misunderstood the reason for using it here.

This is great to hear!

pip cannot prevent creation of intermediate wheels, because in the general case the "transformation" of a Python source distribution into files on disk may only have 1 approach: pip builds the source distribution into a wheel and then installs the wheel into the environment. This is a fact of Python packaging as defined in PEP 517 and not specific to pip.

I actually think that it should be possible to prevent the creation of intermediate wheels. If this is a requirement since PEP 517, I think this is regrettable.

Work with the individual package maintainers to reduce or eliminate cases where a literal prefix path is needed

Indeed. One case where I think it is needed is to specify full paths to kernel executables in the Jupyter kernelspec, so that they can be found even when not in the PATH.
At the moment, we achieve this by post-processing the result of the build with pip, as you suggest.

But even outside of conda, when installing in a known prefix from an sdist, the kernelspec could include the full path as expected.

@pradyunsg
Copy link
Member

installing package from source without building a wheel

This is not going to be possible for pyproject.toml-based projects (i.e. what PEP 517 started with standardising). We're going to remove setup.py install based installations from pip in a future release.

Beyond that, I don't think there's much actionable here; so I'm gonna go ahead and close this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 30, 2022
@pradyunsg pradyunsg removed the S: needs triage Issues/PRs that need to be triaged label Mar 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
state: needs reproducer Need to reproduce issue type: support User Support
Projects
None yet
Development

No branches or pull requests

4 participants