dh-virtualenv icon indicating copy to clipboard operation
dh-virtualenv copied to clipboard

Question: is it supported to use requirements files w/ dh_virtualenv --preinstall

Open benbariteau opened this issue 6 years ago • 6 comments

It turns out that this workflow is useful to me and I noticed that it works, since this just gets passed to pip. However, I don't know if this is an interface that I can rely on.

benbariteau avatar Jan 21 '20 22:01 benbariteau

I basically do this fyi:

dh_virtualenv --preinstall=-rrequirements-bootstrap.txt ...

benbariteau avatar Jan 21 '20 23:01 benbariteau

Works in other software like tox, and should be documented with the option. NOT using a space after -r should also be made explicit (makes this more robust against passing in argv arrays).

jhermann avatar Jan 22 '20 10:01 jhermann

I'm all in for supporting this behaviour. Should probably be documented with the --preinstall flag (including the caveats that @jhermann pointed out)

nailor avatar Jan 22 '20 10:01 nailor

Awesome! Since it uses pip, doing --preinstall='-r requirements-bootstrap.txt' fails with an error about no file named " requirements-bootstrap.txt" lol, so documenting might not be necessary.

benbariteau avatar Jan 23 '20 06:01 benbariteau

I think that can still be quite confusing, especially as the leading white space is easy to miss (took me a moment to notice it even in this ticket).

In addition adding this into the documentation somewhat prevents accidentally removing support for such quirk use in future

On Thu, 23 Jan 2020 at 08:56, Ben Bariteau [email protected] wrote:

Awesome! Since it uses pip, doing --preinstall='-r requirements-bootstrap.txt' fails with an error about no file named " requirements-bootstrap.txt" lol, so documenting might not be necessary.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/spotify/dh-virtualenv/issues/292?email_source=notifications&email_token=AAAPRSHKXDD5ELHLFFGPIGDQ7E5Q7A5CNFSM4KJ4TLBKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJWG7GI#issuecomment-577531801, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAPRSD7IHBFWPUDYRA7DOLQ7E5Q7ANCNFSM4KJ4TLBA .

--

  • Jyrki

nailor avatar Jan 23 '20 08:01 nailor

BTW, I always use -r./foo.txt to make it more readable.

jhermann avatar Jan 24 '20 12:01 jhermann