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

support for --editable pip requirements? #134

Open
dougroyal opened this issue Feb 2, 2016 · 6 comments
Open

support for --editable pip requirements? #134

dougroyal opened this issue Feb 2, 2016 · 6 comments
Labels

Comments

@dougroyal
Copy link

My requirements.txt file has requirements that point to my company's internal git repo, for example:

$ cat foo-service/requirements.txt 
-e git+ssh://git@git.example.com/bar-decoder.git@1.1.0#egg=bar_decoder

When I build a package, the easy-install.pth file references the build directory, not the dpkg install dir.

$ cat /usr/share/python/foo-service/lib/python3.4/site-packages/easy-install.pth 
import sys; sys.__plen = len(sys.path)
/home/doug/build_dpkgs/foo-service/debian/foo-service/usr/share/python/foo-service/src/bar-decoder
import sys; new=sys.path[sys.__plen:]; del sys.path[sys.__plen:]; p=getattr(sys,'__egginsert',0); sys.path[p:p]=new; sys.__egginsert = p+len(new)

Everything else works fine; If I update the easy-install.pth file, the service runs as expected.

Are -e or "editable" dependencies supported by dh-virtualenv?

@dennybaa
Copy link

dennybaa commented Feb 3, 2016

+1 . I can't say that it is because of the described issue. However editable dependencies are clearly not supported. .../bin/pip list in the package virtualenv, shows none which are editable.

@einarf
Copy link
Contributor

einarf commented Feb 10, 2016

What is missing to support this? There are so many ways to build packages in python, so it might help to give a concrete use case and point out how and where the new feature appear.

@nailor
Copy link
Collaborator

nailor commented Feb 11, 2016

From the looks of it it seems that the shebang-rename script should peek into the .pth files too. I'm bit concerned that it might be a tad risky for other packages, especially for old 2.x style namespaces (not sure from top of my head if they have a path in the .pth files)

One could make this optional by detecting possible -e or --editable passed to pip or present in requirements.txt, but then it would be a crazy layer of implicit magic.

I think for supporting this the passing of the flag is already supported, either via the provided extra arguments for pip and via the requirements file. What's left is extending the shebang mangling to look into the .pth files (or maybe only easy-install.pth?)

@asottile
Copy link
Contributor

Is there a reason to use editable at all? If you drop -e pip will still install from git

As for the pth file problem, we've solved this in other places with virtualenv-tools. Our fork which supports pth files

@lasizoillo
Copy link

Remove "-e " from your requirements.txt and all will works fine. Now, in pip its supported. See point 4 https://pip.pypa.io/en/stable/user_guide/#requirements-files

@jhermann
Copy link
Contributor

Should be resolved by mentioning it in "howtos" ⇒ add "docs" label

@nailor nailor added docs and removed enhancement labels Sep 28, 2018
mamedin added a commit to artefactual-labs/am-packbuild that referenced this issue Sep 16, 2019
This commit removes dh-virtualenv build path in editable pip requirements and
other local/bin files. There's a bug in dh-virtualenv editable paths:

spotify/dh-virtualenv#134

It happens when requirements.txt file has the "-e" option for git sources, but
it worked in AM version < 1.10 because the "-e" was not used.
mamedin added a commit to artefactual-labs/am-packbuild that referenced this issue Sep 30, 2019
This commit removes dh-virtualenv build path in editable pip requirements and
other local/bin files. There's a bug in dh-virtualenv editable paths:

spotify/dh-virtualenv#134

It happens when requirements.txt file has the "-e" option for git sources, but
it worked in AM version < 1.10 because the "-e" was not used.
mamedin added a commit to artefactual-labs/am-packbuild that referenced this issue Sep 30, 2019
This commit removes dh-virtualenv build path in editable pip requirements and
other local/bin files. There's a bug in dh-virtualenv editable paths:

spotify/dh-virtualenv#134

It happens when requirements.txt file has the "-e" option for git sources, but
it worked in AM version < 1.10 because the "-e" was not used.
mamedin pushed a commit to artefactual-labs/am-packbuild that referenced this issue Sep 30, 2019
This commit removes dh-virtualenv build path in editable pip requirements and
other local/bin files. There's a bug in dh-virtualenv editable paths:

spotify/dh-virtualenv#134

It happens when requirements.txt file has the "-e" option for git sources, but
it worked in AM version < 1.10 because the "-e" was not used
scollazo added a commit to artefactual-labs/am-packbuild that referenced this issue Sep 30, 2019
mamedin pushed a commit to artefactual-labs/am-packbuild that referenced this issue Sep 30, 2019
This commit removes dh-virtualenv build path in editable pip requirements and
other local/bin files. There's a bug in dh-virtualenv editable paths:

spotify/dh-virtualenv#134

It happens when requirements.txt file has the "-e" option for git sources, but
it worked in AM version < 1.10 because the "-e" was not used
scollazo added a commit to artefactual-labs/am-packbuild that referenced this issue Sep 30, 2019
scollazo added a commit to artefactual-labs/am-packbuild that referenced this issue Sep 30, 2019
mamedin pushed a commit to artefactual-labs/am-packbuild that referenced this issue Sep 30, 2019
This commit removes dh-virtualenv build path in editable pip requirements and
other local/bin files. There's a bug in dh-virtualenv editable paths:

spotify/dh-virtualenv#134

It happens when requirements.txt file has the "-e" option for git sources, but
it worked in AM version < 1.10 because the "-e" was not used
mamedin pushed a commit to artefactual-labs/am-packbuild that referenced this issue Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants