Repository: pypa/pip

Issue:
Pip 10.0b1 fails to respect pyproject.toml from GitHub 
* Pip version: 10.0.0b1
* Python version: 2.7.12
* Operating system: Ubuntu Docker 17.10

### Description:

Installing from a `git+` address doesn't seem to read/respect the `pyproject.toml` file, while local installs do.

### What I've run:

```bash
docker run -it ubuntu
apt update && apt install -y python-pip git cmake g++
pip install pip==10.0b1
python -m pip install git+https://github.com/henryiii/skbuild-hello-cpp.git
# FAILS (see below)
```

```bash
docker run -it ubuntu
apt update && apt install -y python-pip git cmake g++
pip install pip==10.0b1
git clone https://github.com/henryiii/skbuild-hello-cpp.git
cd skbuild-hello-cpp
python -m pip install .
# WORKS
```

The failure in the first case is due to skbuild missing, which was specified in the `pyproject.toml` file. While both say "Installing build dependencies ... done", the failing one goes through that step much faster.

```
Collecting git+https://github.com/henryiii/skbuild-hello-cpp.git
  Cloning https://github.com/henryiii/skbuild-hello-cpp.git to /tmp/pip-req-build-IW2Cm7
  Installing build dependencies ... done
Installing collected packages: hello
  Running setup.py install for hello ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-req-build-IW2Cm7/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-qLJToc/install-record.txt --single-version-externally-managed --compile:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-IW2Cm7/setup.py", line 1, in <module>
        from skbuild import setup
    ImportError: No module named skbuild

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-req-build-IW2Cm7/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-qLJToc/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-req-build-IW2Cm7/
```

And the success:

```
Processing /skbuild-hello-cpp
  Installing build dependencies ... done
Building wheels for collected packages: hello
  Running setup.py bdist_wheel for hello ... done
  Stored in directory: /root/.cache/pip/wheels/98/a4/89/b066a6010178297db26156fb8d7047bd973c45bfddd99ea7f8
Successfully built hello
Installing collected packages: hello
Successfully installed hello-1.2.3
```


Discussion:
@pradyunsg is probably best able to comment here. Our PEP 518 support is only partially complete at this point - @pradyunsg is this one of the cases that is deliberately omitted from our current support (in which case the docs should probably be updated to say so)?
This is a bug. I'll investigate, it's likely a simple fix.


Resolving patch:
diff --git a/src/pip/_internal/wheel.py b/src/pip/_internal/wheel.py
--- a/src/pip/_internal/wheel.py
+++ b/src/pip/_internal/wheel.py
@@ -703,7 +703,6 @@ def build(self, requirements, session, autobuilding=False):
 
         buildset = []
         for req in requirements:
-            ephem_cache = False
             if req.constraint:
                 continue
             if req.is_wheel:
@@ -715,10 +714,11 @@ def build(self, requirements, session, autobuilding=False):
                 pass
             elif autobuilding and req.link and not req.link.is_artifact:
                 # VCS checkout. Build wheel just for this run.
-                ephem_cache = True
+                buildset.append((req, True))
             elif autobuilding and not req.source_dir:
                 pass
             else:
+                ephem_cache = False
                 if autobuilding:
                     link = req.link
                     base, ext = link.splitext()


Test patch: