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

Why does pip wheel -r skip editable requirements? #3291

Closed
sbidoul opened this Issue Dec 5, 2015 · 5 comments

Comments

Projects
None yet
3 participants
@sbidoul
Contributor

sbidoul commented Dec 5, 2015

After reading the documentation, I'm hoping the release process for my project could look like this:

pip freeze -r dev-requirements.txt > release-requirements.txt
pip wheel -r release-requirements.txt --wheel-dir=release

Since my dev-requirements.txt contains editable references to several VCS controlled directories, pip freeze generates lines such as -e git+git@github.com:...#egg=.... That looks completely ok so far.

However pip wheel then says Skipping bdist_wheel for ... due to being editable, which is not good. Removing the -e in the frozen requirements does not help because git+git@github.com:... is not accepted as requirements lines.

So I'm wondering if the above pip freeze + pip wheel is a correct workflow (which I hope).

My main question being why pip wheel needs to skip editable packages. I found a comment by @qwcode in #1775 hinting at something, but I could not understand the rationale. I my use case (ie releasing a project), it is perfectly desirable to have a wheel generated for editable requirements.

@xavfernandez

This comment has been minimized.

Show comment
Hide comment
@xavfernandez

xavfernandez Dec 17, 2015

Contributor

Well the point of installing an editable (-e) is to be able to edit the installed directory (without fiddling inside the site-packages). It is based on setuptools's develop command and as such can not be installed via a wheel (at least not in a trivial way, since it does not contain any setup.py file).

You can however pip wheel git+https://github.com/pypa/pip.git or pip wheel git+ssh://git@github.com/pypa/pip.git (without the -e switch).

The git+git@github.com:pypa/pip.git syntax is currently not supported for non-editable install.

Contributor

xavfernandez commented Dec 17, 2015

Well the point of installing an editable (-e) is to be able to edit the installed directory (without fiddling inside the site-packages). It is based on setuptools's develop command and as such can not be installed via a wheel (at least not in a trivial way, since it does not contain any setup.py file).

You can however pip wheel git+https://github.com/pypa/pip.git or pip wheel git+ssh://git@github.com/pypa/pip.git (without the -e switch).

The git+git@github.com:pypa/pip.git syntax is currently not supported for non-editable install.

@sbidoul

This comment has been minimized.

Show comment
Hide comment
@sbidoul

sbidoul Dec 18, 2015

Contributor

@xavfernandez thanks for looking into this. While I think I understand the point of -e, I don't see why I could release my project with pip wheel because there is and editable package in my environment.

Let my explain with a working example. Let's say I'm working on a project called git aggregator.

I first install it with pip install -e git+https://github.com/acsone/git-aggregator.git.

Then when I'm ready to release to production I freeze with pip freeze > frozen-reqs.txt. With frozen-reqs.txt looking like this (edited to remove the -master suffix - see #3296):

argcomplete==1.0.0
colorama==0.3.5
-e git+git@github.com:acsone/git-aggregator.git@d6a594b7175d9615cad0ca805aa4690ed273500e#egg=git_aggregator
kaptan==0.5.8
PyYAML==3.11

And then I want to package it for production with pip wheel -r frozen-reqs.txt --wheel-dir=release.

And, bummer, the result is incomplete because pip skips my editable package.

Admitedly I could post-process frozen-reqs.txt to remove the -e, etc, but it's a pity to have to do that, especially since reading the documentation on repeatability, I expect the process to be seamless.

Moreover #3379 does work and does not break any test.

Contributor

sbidoul commented Dec 18, 2015

@xavfernandez thanks for looking into this. While I think I understand the point of -e, I don't see why I could release my project with pip wheel because there is and editable package in my environment.

Let my explain with a working example. Let's say I'm working on a project called git aggregator.

I first install it with pip install -e git+https://github.com/acsone/git-aggregator.git.

Then when I'm ready to release to production I freeze with pip freeze > frozen-reqs.txt. With frozen-reqs.txt looking like this (edited to remove the -master suffix - see #3296):

argcomplete==1.0.0
colorama==0.3.5
-e git+git@github.com:acsone/git-aggregator.git@d6a594b7175d9615cad0ca805aa4690ed273500e#egg=git_aggregator
kaptan==0.5.8
PyYAML==3.11

And then I want to package it for production with pip wheel -r frozen-reqs.txt --wheel-dir=release.

And, bummer, the result is incomplete because pip skips my editable package.

Admitedly I could post-process frozen-reqs.txt to remove the -e, etc, but it's a pity to have to do that, especially since reading the documentation on repeatability, I expect the process to be seamless.

Moreover #3379 does work and does not break any test.

@gsemet

This comment has been minimized.

Show comment
Hide comment
@gsemet

gsemet Jul 8, 2016

I would like to have an option in pip wheel to force creation of wheel even for editable elements

gsemet commented Jul 8, 2016

I would like to have an option in pip wheel to force creation of wheel even for editable elements

@sbidoul

This comment has been minimized.

Show comment
Hide comment
@sbidoul

sbidoul Jul 8, 2016

Contributor

@stibbons this is done in #3695 and will therefore be in the next pip release.

Contributor

sbidoul commented Jul 8, 2016

@stibbons this is done in #3695 and will therefore be in the next pip release.

@gsemet

This comment has been minimized.

Show comment
Hide comment
@gsemet

gsemet Jul 8, 2016

great ! Thanks!

gsemet commented Jul 8, 2016

great ! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment