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

Allow to specify per-line --install-option in requirements.txt #271

Closed
dgerzo opened this issue Apr 26, 2011 · 54 comments
Closed

Allow to specify per-line --install-option in requirements.txt #271

dgerzo opened this issue Apr 26, 2011 · 54 comments
Labels
auto-locked Outdated issues that have been locked by automation type: enhancement Improvements to functionality

Comments

@dgerzo
Copy link

dgerzo commented Apr 26, 2011

Hello,

This is a feature request, which would allow people to configure a per-line --install-option in requirements.txt for individual packages. This is needed for example when the installation of the package listed in requirements txt needs additional options, like in case of pylibmc, where I need to pass --install-option="--with-libmemcached=/usr/local" on FreeBSD systems.

Passing --install-option="--with-libmemcached=/usr/local" to the pip install -r requirements.txt is a no-go as that makes other packages fail with an unknown option. This is something that makes it difficult to use pip on automated deployments.

Thanks!

@douglatornell
Copy link

+1

I have exactly the same issue on OpenBSD deployments. Glad I checked before I wrote what would have been a duplicate enhancement request.

@daybarr
Copy link

daybarr commented Feb 6, 2012

+1

I asked how to get around this limitation on StackOverflow: http://stackoverflow.com/q/8874638/445073

As well as allowing manual addition of --install-option to the requirements.txt, it would be nice to maintain the round-trip ability by having pip install "remember" what install-options were used, so pip freeze can then write the --install-option back to the requirements.txt so it isn't lost when adding new packages or upgrading existing ones.

@fjollberg
Copy link

+1 I have exactly the same issue as daybarr above.

@lofidevops
Copy link

+1 (although I wish github had an option to show support without having to add a +1 comment - is there a feature request for this somewhere that I could add a +1 comment to?)

@urbushey
Copy link

+1

This would be a great feature!!!

@conrado
Copy link

conrado commented Apr 12, 2012

+1

@carljm
Copy link
Contributor

carljm commented Apr 16, 2012

This is a reasonable feature, pull request welcome.

@mitar
Copy link

mitar commented Sep 22, 2012

+1

3 similar comments
@nethi
Copy link

nethi commented Nov 25, 2012

+1

@gthomas
Copy link

gthomas commented Nov 28, 2012

+1

@richg
Copy link

richg commented Jan 30, 2013

+1

@obeattie
Copy link

+1 (why oh why does GitHub not have a "plus one" feature)

@qwcode
Copy link
Contributor

qwcode commented Jan 31, 2013

Hello, I'm a pip maintainer and agree this is important. 1.3 is due out very soon, so it won't be in that, but it's very much on the radar for 1.4.

@edwelker
Copy link

Awesome, thanks. +1 also.

@socrateslee
Copy link

+1

@gvalkov
Copy link
Contributor

gvalkov commented Jan 31, 2013

I'll have a go at this, but lets agree on a format first. Maybe:

# All args after '--' will be consumed and used for '--install-options'
pylibmc -- --with-libmemcached=/usr/local
# ... or more explicitly
pylibmc --install-options --with-libmemcached=/usr/local

There is also the matter of how -r --requirement lines should be handled.Should --install-options be recursively applied to all requirements in the requirement file? What if the requirements file sets install options of its own?

-r url://to/requirements.txt -- --with-libmemcached=/usr/local

Maybe I should also add line continuations to the requirement file parser?

pylibc==1.0.1 --install-options \
              --with-libmemcached=/usr/local \
              --prefix=/home/gv/.local \
              --bindir=/home/gv/.bin
distribute

@qwcode
Copy link
Contributor

qwcode commented Jan 31, 2013

I think this:

someproject==1.2 --install-option='...'

this allows us to support other options later if need be, w/o confusion.

-r url://to/requirements.txt -- --with-libmemcached=/usr/local

I'd say don't bother supporting that now. they can add the options into the lines in that file.

as for continuations, I'm open to that, but certainly not critical for this. I'd rather that be done separate.

@edwelker
Copy link

Agree with everything @qwcode just said.

@phu
Copy link

phu commented Feb 1, 2013

+1 Also running into this. Will be excellent when pip supports it; for now using a sort of workaround found in the comments here:
http://stackoverflow.com/questions/8874638/how-to-maintain-pip-install-options-in-requirements-file-made-by-pip-freeze

@jaytaylor
Copy link

+1 this is a considerable pain in the ass

@qwcode
Copy link
Contributor

qwcode commented Jul 14, 2013

understood, @gvalkov 's PR is in the 1.5 milestone (i.e. the next release)

@guilload
Copy link

guilload commented Oct 1, 2013

+1

@michilu
Copy link
Contributor

michilu commented Dec 26, 2013

+1

I need --install-option=--static-deps option for installing lxml on Mac OS X 10.7

@munhitsu
Copy link

munhitsu commented Jan 2, 2014

+1 to make graphite users happier

@Almad
Copy link

Almad commented Jan 22, 2014

+1 for --egg with scons, otherwise uninstallable on heroku

@yxw
Copy link

yxw commented Feb 17, 2014

+1

@edwardotis
Copy link

+1 causing problems installing to heroku without this.

@portovep
Copy link

+1

@bepetersn
Copy link

+1 still to this, and hoping someone takes it on soon.

@RaviH
Copy link

RaviH commented Jun 6, 2014

+1

Hi, do we know if there is any traction on this? Would this be available for Python 2.7 or would it only be available with later versions of Python?

@floer32
Copy link

floer32 commented Nov 7, 2014

been a couple of months so - 👍

@darKoram
Copy link

darKoram commented Dec 1, 2014

+1
Thread started april 2011!

@davethecipo
Copy link

+1

@jaytaylor
Copy link

It's been 5 months, so..

+1

@svisser
Copy link
Contributor

svisser commented Dec 14, 2014

+1

1 similar comment
@juztin
Copy link

juztin commented Feb 12, 2015

+1

@boyonwheels
Copy link

+1 I have this issue with python-ldap on freebsd.

@ahammond
Copy link

ahammond commented Mar 4, 2015

+1 salt wants --salt-transport=raet

@dmalikcs
Copy link

+1

@pfmoore
Copy link
Member

pfmoore commented Mar 11, 2015

There have been a lot of +1 comments on this, but until someone comes up with a PR, it's probably not going to go very far. Do any of the people commenting +1 have the time to work up a PR? Even a first draft that needs some help to polish would be good.

@gvalkov
Copy link
Contributor

gvalkov commented Mar 11, 2015

If there are no objections to my original proposal (please refer to my comment from Jan, 2013 and PR #790), I'll look into implementing it again this weekend.

I sincerely hoped that a 'requirements v2' would have materialized by now so that this overly custom fix wouldn't be necessary.

@pfmoore
Copy link
Member

pfmoore commented Mar 11, 2015

I agree with the comments @qwcode made on the design (don't bother allowing --install-options on -r lines, don't bother with the "anything after --" implicit approach, and leave line continuation to a separate PR). But otherwise this looks OK. I'm not 100% clear on where #790 stands on this matter, but assuming it takes those points into consideration, I'll review it once it's rebased.

@msabramo
Copy link
Contributor

#2537 seems to be progressing nicely.

@johnyf
Copy link

johnyf commented Mar 29, 2015

+1

@gvalkov
Copy link
Contributor

gvalkov commented Mar 29, 2015

Hello everyone,

This functionality is now available in PR #2537 and is being considered for inclusion by the pip core team. They've been extremely helpful in reviewing and straightening out some of the loose ends.

Judging by the number of +1s in this thread, I imagine that a lot of you already have a specific use case in mind for this feature. If you happen to have the time, would you consider testing PR #2537?

Here's a quick way of getting the development version of pip + my feature branch:

$ git clone https://github.com/pypa/pip.git && cd pip
$ git fetch origin pull/2537/head:reqfileopts
$ git checkout reqfileopts
$ python -m pip <command> 

Please refer to the per-requirement overrides section for usage information. For example, to install salt with the --salt-transport=raet option from a requirements file:

$ cat > requirements-with-opts.txt <<EOF
salt --global-option="--salt-transport=raet"
EOF
$ python -m pip install -r requirements-with-opts.txt

Thanks,
Georgi

@conrado
Copy link

conrado commented Mar 29, 2015

Georgi, did you reference the right PR? I think you meant #2537

@gvalkov
Copy link
Contributor

gvalkov commented Mar 30, 2015

Certainly. Thank you for the catch, @conrado.

@qwcode
Copy link
Contributor

qwcode commented Apr 12, 2015

closed via #2537

@guyschlider
Copy link

Thats great, but as far as I see it won't respect --global-option with pip freeze, any workaround?

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 3, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation type: enhancement Improvements to functionality
Projects
None yet
Development

No branches or pull requests