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

Permit --no-use-pep517 with editable mode in more cases. #6442

Merged
merged 1 commit into from
Apr 25, 2019

Conversation

cjerdonek
Copy link
Member

@cjerdonek cjerdonek commented Apr 25, 2019

Fixes #6434.

The two new messages this PR introduces are as follows:

  1. "build-backend" present and use_pep517=None raises InstallationError:

Error installing 'my-package': 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.

  1. "build-backend" present and use_pep517=False logs warning:

WARNING: Installing 'my-package' 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.

And for comparison, I'm including one of the messages that already exists from before and remains the same.

  1. "build-backend" not present and use_pep517=None raises InstallationError:

Error installing 'my-package': editable mode is not supported for pyproject.toml-style projects. pip is processing this project as pyproject.toml-style because it has a pyproject.toml file. Since the project has a setup.py and the pyproject.toml has no "build-backend" key for the "build_system" value, you may pass --no-use-pep517 to opt out of pyproject.toml-style processing. See PEP 517 for details on pyproject.toml-style projects.

@cjerdonek cjerdonek added C: PEP 517 impact Affected by PEP 517 processing type: enhancement Improvements to functionality labels Apr 25, 2019
Copy link

@gaborbernat gaborbernat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me, looks good, let's get this shipped.

@cjerdonek cjerdonek force-pushed the issue-6434-pyproject-editable branch from 0a3ff31 to f069769 Compare April 25, 2019 08:42
@cjerdonek
Copy link
Member Author

I tweaked the news entry, FYI.

@gaborbernat
Copy link

Works for me 👍 Any chance for a release today so I can apply a fix in tox today too?

@cjerdonek
Copy link
Member Author

That would be up to @dstufft as he'd most likely be the one to cut the release (assuming he can do it). Also, there are at least a couple other post-release fixes that should go out IMO, too, so there's a question of whether to put those in the same release or not.

@pfmoore
Copy link
Member

pfmoore commented Apr 25, 2019

No time to do more than a quick review, but this LGTM, and I specifically like the approach you've taken.

+1 on merging. I guess it's then up to @dstufft (as the person handling the 19.1 release) to look at getting it released (although if he's unavailable, someone else could take that on).

@cjerdonek
Copy link
Member Author

Thanks, @pfmoore. I need to go off-line, but someone else is welcome to click the merge button.

@gaborbernat Perhaps @jaraco can offer the $50 to @dstufft instead as an enticement. :)

@pfmoore pfmoore merged commit 9861dc7 into pypa:master Apr 25, 2019
@jaraco
Copy link
Member

jaraco commented Apr 25, 2019

I appreciate the work on this. Although I understand why you settled on this approach and that it’s superior to the status quo, it still will require updating every affected project to support pip 19.1.1, which was the busy work I was hoping to avoid when offering the bounty.

Edit:
Nevertheless, I’ll have to do that busy work twice, once for the 19.1 release and again for the 19.1.1 release. So I guess the value is still to be had I’m cutting a release ASAP.

@dstufft, the bounty is yours if this can release today... let me know if you want to split it with Chris.

@gaborbernat
Copy link

all tox driven projects will not need update (as tox will auto enable the feature).

@cjerdonek cjerdonek deleted the issue-6434-pyproject-editable branch April 25, 2019 22:45
matthewfeickert added a commit to scikit-hep/pyhf that referenced this pull request Apr 25, 2019
* Use --no-use-pep517 flag for editable mode during installation and update docs to reflect this
   - pypa/pip#6434
   - pypa/pip#6442
* Add .eggs to Black exclude list
@pradyunsg
Copy link
Member

@cjerdonek @pfmoore I've been AWOL, so sorry if it feels like I'm barging out of place - is there any specific reason we're requiring packages using a setuptools backend to have to specify --no-pep-517 for editable installs?

We already didn't support other use cases for editable anyway and the PEP doesn't explicitly disallow use of editable install mechanisms, since it's outside of the scope of the PEP.

@cjerdonek
Copy link
Member Author

is there any specific reason we're requiring packages using a setuptools backend to have to specify --no-pep-517 for editable installs?

@pradyunsg This is where @pfmoore first provided the rationale when I asked him about this case: #6331 (comment)

@pfmoore
Copy link
Member

pfmoore commented Apr 26, 2019

My reasoning is that what we now have does the job, while remaining with the spirit of the PEP 517 changes - we take the use of the PEP 517 pyproject.toml keys as "opt in" to PEP 517, requiring a deliberate "opt out" via --no-use-pep517 if the user wants it. And "there's no support for editable installs" is a documented (if inconvenient) aspect of PEP 517, for better or worse1.

We could have taken -e as another means for people to opt out, but I'm not sure of the ongoing impact of that, particularly when we come to the point where PEP 517 gets support for editable installs, and we want -e to use PEP 517 :-( And I was strongly against adding yet more weird and wonderful flags without taking the time to understand the implications, so --really-dont-use-pep517 options were never something I was happy with.

Beyond that, it was mostly about finding something that we could implement quickly, but without leaving us with maintenance issues down the line that we didn't understand the consequences of.

What I mostly want to come from this is for people to look at actually adding editable mode to PEP 517. If that doesn't happen, then I'll be very disappointed, because this issue has demonstrated that there's a significant need for that work.

1 The only real reason PEP 517 doesn't support editable installs was because the participants at the time were basically burned out working on what we did get. No-one thought they were insignificant, or that a PEP without them was the final answer. But we had to stop somewhere, and start implementing the design, or we'd never have any real world feedback to validate what we did have.

@pradyunsg
Copy link
Member

pradyunsg commented Apr 26, 2019

Basically, my main concern with this approach is that we're going to have some legacy overhead for editable installs until that void is filled within our standards, but disrupting user workflows as a part of the transition would negatively affect how folks perceive pip and PyPA broadly.

"there's no support for editable installs" is a documented (if inconvenient) aspect of PEP 517

-e being an opt-out makes sense to me, precisely because PEP 517 doesn't specify the behavior. IMO it meant we should probably continue our status-quo behavior, possibly printing a warning if pyproject.toml exists, that "Hey, PEP 517 support is disabled on this because this is an editable install and the PEP doesn't cover that yet". As for the consequences of doing this, I don't think this adds any maintenance burden in the short term, and in the long term, we'll have a similar transition as legacy -> PEP 517 builds either way.

OTOH, requiring users to specify --no-pep-517 creates a lot of busy work that has to be undone once the editable discussion is done. It pushes us to have it soon, but we don't know if and when folks will have the time and energy to.

@pradyunsg
Copy link
Member

And I was strongly against adding yet more weird and wonderful flags without taking the time to understand the implications, so --really-dont-use-pep517 options were never something I was happy with.

FWIW, I agree that adding more options is not a good idea.

With use_pep517 == True, editable installs should definitely fail. When it's None, I don't think we should fail them precisely because of the disruption it can/has caused.

@pfmoore
Copy link
Member

pfmoore commented Apr 26, 2019

I'm happy to duck out at this point and leave the decision to others. If the consensus is to revert @cjerdonek's change in favour of an alternative approach that's fine with me. There was a lot of pressure yesterday for a quick solution, and if as a result I let myself be pushed into arguing for the wrong approach, then I apologise.

@cjerdonek
Copy link
Member Author

cjerdonek commented Apr 26, 2019

I think it would be better to discuss this on the Discourse category instead of on this closed issue.

@xavfernandez
Copy link
Member

I'm in phase with @pradyunsg analysis.

@cjerdonek
Copy link
Member Author

@pradyunsg
Copy link
Member

@pfmoore You don't need to apologize for anything. I hope I didn't come across wrong as I don't mean to undermine the work that you and Chris have done for this release cycle. Thank you for doing the post-release firefighting and sorry for not being there.

In fact, you've stated your reasoning and position very clearly and that has definitely been very helpful.

@lock
Copy link

lock bot commented May 28, 2019

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

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label May 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators May 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation C: PEP 517 impact Affected by PEP 517 processing type: enhancement Improvements to functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pip 19.1 and develop mode (with pyproject.toml - build-backend present)
7 participants