Closed theahura closed 1 year ago
Does -e file:../../foo/bar
work for you? See also https://github.com/jazzband/pip-tools/issues/204.
fantastic! that works great, thank you for the quick turnaround!
FWIW the original form (-e ../../foo/bar
) works in my feature/relpaths-post-6.8.0
branch, which can be tested for example with pipx
:
$ pipx run --spec 'pip-tools @ git+https://github.com/AndydeCleyre/pip-tools@feature/relpaths-post-6.8.0' pip-compile
What's the problem this feature will solve?
My requirements.in file has an editable install,
-e ../../foo/bar
. When this gets converted to requirements.txt with piptools, it turns into-e file:///home/theahura/path/to/foo/bar
.The issue is that if anyone else on my team wants to use this requirements.txt, it will break; and if they recompile, the requirements.txt gets an unnecessary update.
Describe the solution you'd like
Turns out that relative path editable installs work just fine in a requirements.txt. It's possible to just have
-e ../../foo/bar
in the requirements.txt AND the requirements.in. So one option would be:pip-compile requirements.in --relative_editable_installs=true
which would output the relative path to
requirements.txt
instead of the absolute one.Alternative Solutions
Currently I hardcode any relative editable paths in my requirements.txt, which works fine from a pip-install perspective. Unfortunately, pip-tools will then go and update it back to the absolute path whenever a recompile occurs