Repository: pypa/pip

Issue:
pip 19.1 and develop mode (with pyproject.toml - build-backend present)
So I get now pip is PEP compliant, and the reasons why it was done.

However, this now breaks peoples workflow without any sane workaround (the only one to work is to remove pyproject.toml file before install and put it back afterwards), I consider it as a PEP oversight to not specify that it does not apply for editable installs.

PEP-517/8 on purpose did not want to cover editable installs, considering something to be addressed down the line (there's some discussion on the topic upstream, but that's ages away from reality). As such I would argue PEP-517/PEP-518 no longer applies when editable install mode is enabled. It's the build frontend dependent on how this case is handled. 

We have two options now:
- In develop mode, pip should fallback to the old system, maintain the status quo until we figure out how to support editable installs in the new world. 
- Alternatively, provide a flag that triggers the old build system independent of the presence/content of the ``pyproject.toml``. 

Note this now breaks *a lot* of dependent systems (pipenv, tox, poetry, etc).


Discussion:
While I'm not trying to apportion blame here, it should be noted that a much simpler fix would be to simply delete `pyproject.toml`. The reason this isn't possible appears to be because projects like `black` chose to use that file for their general configuration, which is arguably allowed by PEP 518 (it depends on how you define "build tool", basically) but might be considered a bit premature, when the *intended* use of that file (PEPs 517 and 518 were still in development).

We need to find a way forward, and not look back at how we got here, but it might be worth someone looking at the possibility of black adding support for configuraion in `setup.cfg`. I don't know if other tools have `pyproject.toml`-only configuration - if the problem is significantly more widespread than just black, then this may not be a practical solution.
@pfmoore it's not important how we got here or who is to blame. 

The workflow that this breaks is the following: you want to distribute your code as PEP-517/518. And you're testing with pure PEP-517/518 in your CI/tox. However, while developing the codebase it's helpful to install the code in developer mode (to avoid needing to reinstall the package after every code-change to run your tests). In such case, you do want to install the code in editable mode (but also to keep the pyprojec.toml). Deleting the file is not possible in this case. Specifying no pep 517 builds also doesn't work.
Ah, OK. There's so many cases being discussed across various issues that I'd missed that this was talking about a different situation<sup>1</sup>. Sorry.

That's definitely a fair comment then - although it's probably worth being clear when documenting this that you would be doing your development with what is essentially a completely different build system than the one you're going to deploy with. As an example, console script wrappers are handled in a completely different way depending on whether you use the legacy direct install method or the PEP 517 install via wheel method.

<sup>1</sup> It might be worthwhile for someone to collect together the various use cases we're seeing reported here and document them, as a starting point for the inevitable "how to extend PEP 517 to support editable mode" discussion. If nothing else, this whole debate makes it clear that the need for a standard covering editable mode isn't something we can put off too long.
@pfmoore that's okay though, editable mode always was a close enough approximation; the non-editable test suits are the ones that confirm ``100%`` the code is good. For example, if one would load resources they can behave differently. But this is already the case. As such needing to pass some flags is alright, however, for now, there's no way to do this. Can we get a fix? ``--really-ignore-pep517-for-develop-mode`` is fine by me.
Specifying no pep 517 worked for me. For anyone who hit this when using tox, adding a custom `install_command` line to `tox.ini` is my current workaround (I only have pyproject.toml for setting the line length for black).

```
[testenv]
install_command =
    python -m pip install --no-use-pep517 {opts} {packages}
```
That's a different problem, as you don't have build-backend and requires specified.
@gaborbernat Can you do something like have a simple wrapper script you use when developing locally that moves the file prior to installing in editable mode? Or copying the `pyproject.toml` file into place when running in CI, etc? I'm not sure the exact situation, but it seems like you'd have a fair amount of flexibility in coming up with a workflow.
Moving around the files is a really bad workaround and would generate a lot more trouble. This now breaks tox for example. tox it's no longer able to create a develop environment.

While moving the pyproject.toml out and back would workaround the issue (in a scary horrible way), it would break parallel mode. Imagine if you want to run 5 tox environments in parallel, 4 of them use PEP 517/518 and one wants an editable install (for example is the only way cython code coverage can be done). Again feels to me like a bad place to be, now one would need some lock to hold why **altering** the work tree, just to get an editable install through. On this point, I either downgrade to pip < 19.1, or use ``python setup.py develop``... I would really prefer a true PEP-517/PEP-518 disable behind an obscure flag. Wrapper scripts at that point can pass through that, rather than altering the source directory in-place.
> Imagine if you want to run 5 tox environments in parallel, 4 of them use PEP 517/518 and one wants an editable install

Okay, but that's a different scenario from what you mentioned above. I was responding to what you wrote. Above you just said you wanted to install in develop mode when developing locally, and run CI/tox in pure PEP-517/518.

Like I said above, I don't know your exact situation. It just feels to me like you would have a lot of options given that you can structure things however you want in your repo and local environment.

Well, I never said that I do ``install in develop mode when developing locally`` manually (I use tox for that too) or not in parallel with some other operation on the same repo. pip installs at the moment are parallel safe, your suggestion would break that constant, so it's not a true workaround.
> Can we get a fix?

Even assuming someone pulls together a proposal that covers all the various issues that are getting raised, and gets agreement from everyone, it'll still need implementing. We're still only at the stage of everyone contributing their use case, and we haven't got much clarity on what is the best way forward yet. Stage one is probably for someone to step up and manage the various threads and discussions going on here (we really need *one* proposal to handle all the use cases, not multiple "temporary" solutions).

Also, the next pip release isn't for 3 months, so there's no huge rush. Let's think things through and make sure we have a good solution before rushing into someone writing a PR.

But yes, we can get a fix, in due course.

PS It might actually be possible to get a PEP 517 extension supporting editable mode sorted in the 3 months before pip's next release - let's not waste all of the energy here on temporary solutions if we can harness it to address the underlying problem!
One other question - is this something new in pip 19.1? The PEP 517 support was introduced in 19.0, a few months ago - is there something in 19.1 that makes it worse?  If not, then how come this issue has suddenly flared up now? Just coincidence?
> Also, the next pip release isn't for 3 months, so there's no huge rush. Let's think things through and make sure we have a good solution before rushing into someone writing a PR.

This breaks a lot of CIs and workflows. Notably mypy, tox, virtualenv (but a lot-lot more within my workplace). I consider this to be a bug-fix request, so waiting for three months feels to me not the right way to go.
pip ``19.0.0`` allowed develop mode (without satisfying the requires section) when pyproject.toml was present. pip 19.1 via https://github.com/pypa/pip/pull/6370 decided to hard error instead. 
So #6370 says to use `--no-use-pep517`. Are you saying that the PR is broken, and it *doesn't* (as stated) "Get pip install -e working again for the PEP 517-is-optional case (provided --no-use-pep517 was passed)"?

If the PR is not delivering what it claims to deliver, then let's fix that (and yes, such a fix might warrant a 19.1.1 release), not add yet more options and workarounds. But we'd need instructions on how to reproduce the breakage in that case.
see https://github.com/pypa/pip/pull/6370#issuecomment-486156720

> > The simplest work-around for people should be to add --no-use-pep517 to any invocation that requires editable mode (which I believe any error message you're seeing should say)
> 
> That fails with:
> 
> ```
> ERROR: Disabling PEP 517 processing is invalid: project specifies a build backend of setuptools.build_meta in pyproject.toml
> ```
> This seems to imply that PIP refuses to opt-out of PEP 517 if there is a `build-backend` in the `pyproject.toml` even if the environment allows to just run `setup.py` directly.


@pfmoore This issue is about the first of the two PR's: https://github.com/pypa/pip/pull/6331 rather than the second.

The first is the case where PEP 517 mandates that `pyproject.toml`-style be used and so `--no-use-pep517` isn't permitted.


I think PEP-517/518 does not cover/handle editable install (on purpose, TBD) so there's nothing mandating things actually once someone asks editable install. But at the very least we should be able to disable entirely PEP-517 in case of editable installs.
@pfmoore Here are the two main comments from you where we talked about this before the two PR's were implemented:

* https://github.com/pypa/pip/issues/6314#issuecomment-469176276

* https://github.com/pypa/pip/pull/6331#issuecomment-473231822

@cjerdonek Thanks. This still seems correct - PEP 517 doesn't support editable mode, so projects shouldn't use it if they want to support editable mode.

This *does* emphasise the need for someone to reopen the standardisation process for editable mode under PEP 517. And when it's been agreed, pip will (of course) follow it.

The decision for pip to switch to PEP 517 mode when a PEP 517-style source layout was detected was made right back in the beginning of the implementation. I pushed for it (I believed then, and still do, that  it's important to exercise the new code path where possible, and writing your source code to use the new features seems like a pretty strong opt-in), but it was generally agreed to be the correct choice. And I still believe it is - if we'd held back on using the new code path, how would we have found out that the lack of editable mode was such a significant issue? We'd just have been delaying the point when this issue arose.

Moving forward, though, we do need to work out what to do next.
@pfmoore in the meantime we agree on editable installs do we still plan to offer the legacy editable install mode (behind some weird flag) or pip 19.0.0 has dropped editable install support for now, and worked only by chance pre 19.1? 

I don't agree this is a good approach. Basically, you're saying whoever wants to use editable install for development needs to drop pyproject.toml PEP-517/518 for deployment too.
@gaborbernat When asking these questions, for clarity you should distinguish between the two cases of whether "build-backend" is present in `pyproject.toml` or not because the answer is different in the two cases. If you don't distinguish, it can create confusion because people won't know which case is being referred to.
Changed name of the issue to reflect scope.
I have [proposed discussing this at the Packaging Mini-summit](https://discuss.python.org/t/packaging-mini-summit-pycon-us-2019-topic-suggestions/1534/6?u=pganssle), to the extent that "likes" are considered votes, liking it will help get it prioritized.

Either way, maybe we can get the new standard jump-started at PyCon next week? I'm thinking an open space to flesh out ideas among people interested would be good, if there's time.
Now that the issue name sets the scope, I'll re-ask:

In the meantime we agree on editable installs do we still plan to offer the legacy editable install mode (behind some weird flag) or pip 19.0.0 has dropped editable install support for now, and worked only by chance pre 19.1?

I don't agree this is a good approach. Basically, you're saying whoever wants to use editable install for development needs to drop pyproject.toml PEP-517/518 for deployment too.
> @pfmoore in the meantime we agree on editable installs do we still plan to offer the legacy editable install mode (behind some weird flag) or pip 19.0.0 has dropped editable install support for now, and worked only by chance pre 19.1?

Huh? I'm not sure what you're asking here. And I'm not sure who "we" is in this context. But my personal view is:

1. Editable installs are still supported exactly as prior to pip 19 - for non-PEP 517 projects (those that don't have `build-backend` in `pyproject.toml`). You may need `--no-use-pep517`.
2. PEP 517 has never supported editable installs, although pip 19.0 did have some cases where it fell into a mode that mixed PEP 517 and legacy processing. Those cases had problems in 19.0, we fixed them in line with the "PEP 517 does not support editable installs" principle, by being clearer that editable mode wasn't supported by PEP 517.

Apparently (remember, this is just my opinion here!) there are a lot of people who opted into PEP 517 without worrying too much about the "doesn't support editable installs" issue, who ended up relying on pip's sort-of support. They are now struggling because of (2) above, and it would be good if pip had an answer for them. I'd prefer that answer to be standards-based, but I appreciate that's not a short-term fix. If someone offers a short-term fix (a PR) I'll take a view on it at that stage, but I'm not at all keen on any sort of `--make-it-go-away` style of option - I'd rather whatever gets done fits better into what pip already has.

Full disclosure: I won't personally have any free time to develop a solution for this in the short term (next few weeks). And even if I did, I'd rather review solutions from someone with practical experience of the problem than try to work out what's best myself.

PS One possible option (@cjerdonek - I don't know how practical this would be, maybe you can comment?) would be to alter the places where we raise `make_editable_error` to instead simply report the message as a (strong) warning, saying that using editable with PEP 517 projects is undefined, and you use it at your own risk - but then carry on without raising. If that falls through back to the old behaviour, the user has been warned but we don't stop their build. I would expect that if we do this, we don't offer support for users experiencing weird behaviour if this message was displayed... (I also wouldn't bother adding tests for this behaviour, or anything like that - make it truly unsupported).
I would be just fine with a big red warning written on stderr - ``PEP-517 detected but editable install requested, this combination is not supported, will fallback to pre PEP-518/7 mode``; @cjerdonek ?

PS. We as in PyPa, maintainers of the PyPa packages.
Note that I'm not committing to "fallback to pre PEP-517/8 mode" - the reality is that I think it's more "fall back to some weird frankenstein mode that's mostly legacy with some PEP 518 in there" :-) But the point is that I don't actually *know* what it'd do.

Not sure how you'd get an opinion from "PyPA" as a whole, the only formal method for doing that is standards. I can only offer my personal opinion, and most of the PyPA people don't follow the pip tracker. We're not even close to seeing a consensus opinion from the pip maintainers yet...
@pfmoore wouldn't it fallback to same as without the ``pyproject.toml``, meaning the same state it did pre PEP-517/PEP-518 - probably meaning just invoking ``python setup.py develop`` until we get a standardized develop mode.
> Note that I'm not committing to "fallback to pre PEP-517/8 mode" - the reality is that I think it's more "fall back to some weird frankenstein mode that's mostly legacy with some PEP 518 in there" :-) But the point is that I don't actually know what it'd do.

I realize that last time we had a lot of trouble getting the `pip ~=18` PEP 518 behavior after the PEP 517 changes went in, but I think the ideal situation would be to fall back to pip's PEP 518 behavior (i.e. building the isolated build environment), then invoke `setup.py develop`.
Hi all,
spent the entire morning trying to figure out why my packages stopped building today. This is my configuration at work:

`pipenv 2018.11.26` create a new virtualenv which (since today) has `pip 19.1` installed by default. There is a `pyproject.toml` file in the project root dir with the following section:

```
[build-system]
requires = [
    "setuptools",
    "wheel",
]
```
which means there is a "build-backend" defined, I suppose. The package is installed in edit-mode for convenience reasons (tests, and so on). `pyproject.toml` also contains settings for `black` and `tidypy`. @pfmoore can't remember where you mentioned that just black is using `pyproject.toml` for its settings, but apparently also `tidypy` is doing that.

Since I use `pipenv` (not `pip` directly) I was not able to make ``--no-use-pep517`` work (because version `2018.11.26` doesn't support that). The only way I was able to get my environment back to work was to `export PIP_USE_PEP517=false`. If there is a better way to get it done (at least for the time being please feel free to chime in).

Earlier this morning (before this isssue was opened) I've also tried to remove the `[build-system]` section from the `pyproject.toml` file without any success, so I'm not sure if the distinction between with/without "build-backend" is real or it is just me getting something wrong.
In my projects, I've been [specifying PEP517/518 as a matter of course](https://github.com/jaraco/skeleton/commit/32b254dee01b5ef2b695ae04889af482c6cb28c3) in order to (a) prove the behavior, (b) opt-in to best practices, and (c) evangelize the functionality.

In many of the projects, the 'editable' workflow is the one that works most consistently (avoiding issues relating to consistency and duplication inherent in the copy that a built install necessarily creates).

If the recommendation is that PEP517 is essentially non-viable for projects that need editable installs, that's going to mean a major transition for hundreds, maybe thousands of projects.

Options our dev team are considering:

- Block pip 19.1 and later at the package index
- Stop using editable projects and deal with the fallout
- Hack tox to pin to older pip

I'd much prefer an approach like `--really-ignore-pep517-for-develop-mode` that Bernát proposed.
Whatever workaround we come up here tox will swiftly adopt it, as long it makes developer mode work without removing the ``pyproject.toml``. And yes part of that very well can be print out a big red message that FYI you're in unsupported land.

> @pfmoore wouldn't it fallback to same as without the ``pyproject.toml``, meaning the same state it did pre PEP-517/PEP-518 - probably meaning just invoking ``python setup.py develop`` until we get a standardized develop mode.
> @pfmoore wouldn't it fallback to same as without the pyproject.toml, meaning the same state it did pre PEP-517/PEP-518 - probably meaning just invoking python setup.py develop until we get a standardized develop mode.

I don't know, is the honest answer. The code is very different now than it was before PEP 517 support was added.
Let's find it out and create a solution is my proposal. Can we agree on that while we do get PEP-517 editable mode in place doing in the meantime:

> I think the ideal situation would be to fall back to pip's PEP 518 behavior (i.e. building the isolated build environment), then invoke setup.py develop.

is the right way to be; with a big red message saying this behaviour will change as soon as we get proper PEP-517 editable mode done. If so I can try creating a PR doing this, and release it as ``19.1.1``.

This would allow people to follow PEP-517/8 best practices for distribution but fallback to something sane for development (which will change at some point).
@gaborbernat I believe @ncoghlan took a crack at restoring the PEP 518 behavior when we were first scrambling to deal with the relative imports issue and eventually abandoned it. He may have thoughts as to how feasible this is.

Given that we've really wanted a "fall back to PEP 518 only" option *twice* now, it seems to me that it's worth putting in the effort. 

**Edit** To clarify: I do not mean "fall back to PEP 518" as a `pip` option, just as a code path. My understanding is that when PEP 517 support was added, it was added *in place* of the PEP 518 support, so the two are inextricably linked. Having a code path that `pip` can take that falls back to PEP 518 in certain scenarios is something we've needed twice now to implement "quick fix" patches.
I would not make it myself disable-able PEP-517 as such. But instead, disable only in case of editable install.
_(this is probably a topic for a separate discussion but I'll state it here)_

It looks like major changes keep *unexpectedly* break dists in the wild.
One solution to this would be introducing testing of the downstream libs: these could be libs with known "weird configs" and/or random things on PyPI. At least running different cases against those once a week should raise a red flag faster...
(This doesn't negate the need for those downstreams to run tests against pip's master branch on their side as well)
> PS One possible option (@cjerdonek - I don't know how practical this would be, maybe you can comment?) would be to alter the places where we raise make_editable_error to instead simply report the message as a (strong) warning,

This would be straightforward (essentially just changing the `raise` to logging a warning in the appropriate cases, and updating the test cases). The relevant code starts here:
https://github.com/pypa/pip/blob/9816d17ccaf33dc5450b74ad310b6827915e2fe7/src/pip/_internal/pyproject.py#L136
Someone just needs to decide what the behavior should be. Personally, I'm okay with whatever @pfmoore decides and will defer to him.

I think @pfmoore's suggestion is quite good for immediate firefighting...
I'll see if I can work something up within the next couple days and then we can review what the warning text should be, etc.
Hey @cjerdonek - each day that passes with this release means more projects that require a patched release process. I'd gladly put a $50 bounty on a bugfix release if it can be made in the next 36 hours.
@pfmoore To clarify, was your proposal in [this comment](https://github.com/pypa/pip/issues/6434#issuecomment-486258665) that if editable mode is requested (for both the "build-backend" and without-"build-backend" cases), then it automatically opts out of PEP 517 processing with appropriate warnings? Or would `--no-use-pep517` still be required in both cases? My understanding of your suggestion (whether or not `--no-use-pep517` is required) is that there should be a warning in both cases that the legacy behavior might not work the same, but the wording would be stronger in the case that "build-backend" is present (saying the behavior is currently undefined in the spec).

On the above, it would seem weird to me if we required `--no-use-pep517` only when "build-backend" isn't present. That would mean that adding "build-backend" when editable mode is being used would have the same effect as passing `--no-use-pep517` (only the warning text would be different).

I don't have a suggestion as such - it just occurred to me that replacing "raise" with "print the message and continue" might do more or less what the code used to do (the PR that added the raise pretty much just did "if <some condition> then raise").

But I've no feel at all for what would be a "good" option here. If the situation is serious enough, reverting #6314 and #6331 might be warranted. If not, then someone needs to decide how to preserve the spirit of those two patches, while fixing the current breakage. But beyond not being happy with a "switch off PEP 517" blunt instrument option, I haven't had time to think the issue through at all.
My thoughts are that I don't think we should revert because it would only push the problems further down the road and in the process make them even bigger and harder to deal with later (and maybe even intractably so). The purpose of the change was in part to deal with this issue while we still had more of a chance.

Regarding the path forward, my feeling is that `--no-use-pep517` should be needed in either both cases or neither (with or without the "build-backend" key). That choice results in a tradeoff when it comes to future changes in behavior. If we don't require the flag now, people will complain when PEP 517 adds support for editable and things behave differently, and maybe limit us in terms of what choices we can make when considering editable for PEP 517. If we do require the flag now, the problem is that people may complain that it's inconvenient to have to use the option and maybe it doesn't work correctly in all cases (e.g. the issue with nested requirements file).
I agree with your analysis. My preference would be to require `--no-use-pep517` to make it explicit. If I understand the comments above, that essentially makes `--no-use-pep517` act similar to the `--make-it-just-work` flag people were asking for, so I think that should be an acceptable inconvenience.

Resolving patch:
diff --git a/src/pip/_internal/pyproject.py b/src/pip/_internal/pyproject.py
--- a/src/pip/_internal/pyproject.py
+++ b/src/pip/_internal/pyproject.py
@@ -1,6 +1,7 @@
 from __future__ import absolute_import
 
 import io
+import logging
 import os
 import sys
 
@@ -15,6 +16,9 @@
     Pep517Data = Tuple[str, List[str]]
 
 
+logger = logging.getLogger(__name__)
+
+
 def _is_list_of_str(obj):
     # type: (Any) -> bool
     return (
@@ -133,7 +137,11 @@ def resolve_pyproject_toml(
     # opposed to False can occur when the value is provided via an
     # environment variable or config file option (due to the quirk of
     # strtobool() returning an integer in pip's configuration code).
-    if has_pyproject and not has_setup:
+    if editable and use_pep517:
+        raise make_editable_error(
+            req_name, 'PEP 517 processing was explicitly requested'
+        )
+    elif has_pyproject and not has_setup:
         if use_pep517 is not None and not use_pep517:
             raise InstallationError(
                 "Disabling PEP 517 processing is invalid: "
@@ -145,7 +153,36 @@ def resolve_pyproject_toml(
             )
         use_pep517 = True
     elif build_system and "build-backend" in build_system:
-        if use_pep517 is not None and not use_pep517:
+        if editable:
+            if use_pep517 is None:
+                message = (
+                    'Error installing {!r}: editable mode is not supported '
+                    'for pyproject.toml-style projects. '
+                    'This project is pyproject.toml-style because it has a '
+                    'pyproject.toml file and a "build-backend" key for the '
+                    '"build_system" value, but editable mode is undefined '
+                    'for pyproject.toml-style projects. '
+                    'Since the project has a setup.py, you may pass '
+                    '--no-use-pep517 to opt out of pyproject.toml-style '
+                    'processing. However, this is an unsupported combination. '
+                    'See PEP 517 for details on pyproject.toml-style projects.'
+                ).format(req_name)
+                raise InstallationError(message)
+
+            # The case of `editable and use_pep517` being true was already
+            # handled above.
+            assert not use_pep517
+            message = (
+                'Installing {!r} in editable mode, which is not supported '
+                'for pyproject.toml-style projects: '
+                'this project is pyproject.toml-style because it has a '
+                'pyproject.toml file and a "build-backend" key for the '
+                '"build_system" value, but editable mode is undefined '
+                'for pyproject.toml-style projects. '
+                'See PEP 517 for details on pyproject.toml-style projects.'
+            ).format(req_name)
+            logger.warning(message)
+        elif use_pep517 is not None and not use_pep517:
             raise InstallationError(
                 "Disabling PEP 517 processing is invalid: "
                 "project specifies a build backend of {} "
@@ -153,18 +190,8 @@ def resolve_pyproject_toml(
                     build_system["build-backend"]
                 )
             )
-        if editable:
-            reason = (
-                'it has a pyproject.toml file with a "build-backend" key '
-                'in the "build_system" value'
-            )
-            raise make_editable_error(req_name, reason)
-        use_pep517 = True
-    elif use_pep517:
-        if editable:
-            raise make_editable_error(
-                req_name, 'PEP 517 processing was explicitly requested'
-            )
+        else:
+            use_pep517 = True
 
     # If we haven't worked out whether to use PEP 517 yet, and the user
     # hasn't explicitly stated a preference, we do so if the project has


Test patch:
diff --git a/tests/unit/test_pep517.py b/tests/unit/test_pep517.py
--- a/tests/unit/test_pep517.py
+++ b/tests/unit/test_pep517.py
@@ -84,9 +84,6 @@ def test_resolve_pyproject_toml__editable_without_use_pep517_false():
     'has_pyproject, has_setup, use_pep517, build_system, expected_err', [
         # Test pyproject.toml with no setup.py.
         (True, False, None, None, 'has a pyproject.toml file and no setup.py'),
-        # Test "build-backend" present.
-        (True, True, None, {'build-backend': 'foo'},
-         'has a pyproject.toml file with a "build-backend" key'),
         # Test explicitly requesting PEP 517 processing.
         (True, True, True, None,
          'PEP 517 processing was explicitly requested'),
@@ -115,6 +112,55 @@ def test_resolve_pyproject_toml__editable_and_pep_517_required(
         )
 
 
+def test_resolve_pyproject_toml__editable_build_backend_use_pep517_none():
+    """
+    Test editable=True with "build-backend" and use_pep517=None.
+    """
+    expected_start = (
+        "Error installing 'my-package': editable mode is not supported "
+    )
+    expected_substr = 'you may pass --no-use-pep517 to opt out'
+
+    with assert_error_startswith(
+        InstallationError, expected_start, expected_substr=expected_substr,
+    ):
+        resolve_pyproject_toml(
+            build_system={'requires': ['my-package'], 'build-backend': 'foo'},
+            has_pyproject=True,
+            has_setup=True,
+            use_pep517=None,
+            editable=True,
+            req_name='my-package',
+        )
+
+
+def test_resolve_pyproject_toml__editable_build_backend_use_pep517_false(
+    caplog
+):
+    """
+    Test editable=True with "build-backend" and use_pep517=False.
+    """
+    resolve_pyproject_toml(
+        build_system={'requires': ['my-package'], 'build-backend': 'foo'},
+        has_pyproject=True,
+        has_setup=True,
+        use_pep517=False,
+        editable=True,
+        req_name='my-package',
+    )
+
+    records = caplog.records
+    assert len(records) == 1
+    record = records[0]
+    assert record.levelname == 'WARNING'
+    expected_start = (
+        "Installing 'my-package' in editable mode, which is not supported "
+    )
+    assert record.message.startswith(expected_start), (
+        'full message: {}'.format(record.message)
+    )
+
+
 @pytest.mark.parametrize(
     'has_pyproject, has_setup, use_pep517, editable, build_system, '
     'expected_err', [