Pip-tools: pip-compile generates "-e /path/to/local/dir" in requirements.txt

Created on 29 Feb 2016  路  4Comments  路  Source: jazzband/pip-tools

Similar use case as in #176 and possibly #223 -- I'm trying to eliminate duplication between setup.py and requirements.in. Here's a small repro:

$ cat requirements.in
-e .
$ cat setup.py
from setuptools import find_packages, setup

setup(
    name='foobar',
    install_requires=[
        'contextlib2',
    ],
)
$ pip --version
pip 7.1.0 from /Users/blampe/src/pip-tools-test/env/lib/python2.7/site-packages (python 2.7)
$ pip-compile --version
pip-compile, version 1.6
$ pip-compile --no-index
#
# This file is autogenerated by pip-compile
# Make changes in requirements.in, then run this to update:
#
#    pip-compile --no-index requirements.in
#
-e file:///Users/blampe/src/pip-tools-test
contextlib2==0.5.1

I'd expect this to only include contextlib2 but it also has an unportable "-e" path. This causes errors when trying to install from requirements.txt on any other machine.

Most helpful comment

Yeah totally agree, I have a similar use case. The real problem is that it's an absolute path instead of relative. Feel free to close this if it's a dupe of #204.

All 4 comments

FWIW, I _would_ expect it to keep the -e ., because the foobar package still needs to be installed. For my own uses, it still needs to be installed because I have the package in a src directory (so that it's not importable without installation), and because it installs a script. It just needs to remain a relative path so that it doesn't break when installed in a different repository, machine, etc.

Yeah totally agree, I have a similar use case. The real problem is that it's an absolute path instead of relative. Feel free to close this if it's a dupe of #204.

Closing as duplicate to #204, let's continue there.

The known workaround is -e file:.#egg=foobar. See https://github.com/jazzband/pip-tools/issues/204#issuecomment-550051424.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vphilippon picture vphilippon  路  4Comments

nicoa picture nicoa  路  3Comments

sirex picture sirex  路  4Comments

astrojuanlu picture astrojuanlu  路  3Comments

ssbarnea picture ssbarnea  路  5Comments