Skip to content

Add --install-options and --global-options to requirement parser + refactor #790

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

Closed
wants to merge 6 commits into from

Conversation

gvalkov
Copy link
Contributor

@gvalkov gvalkov commented Feb 5, 2013

Hi all,

This pull requests adds the functionality requested in #271 and #515. In brief, it allows you to pass --install-options and --global-options in the requirements file. Example:

INITools==2.0 --global-options="--help" --install-options="--prefix=/opt"

I've also completely refactored parse_requirements() and added more tests.

Reviewing by commit might be easier than going to 'Files Changed', imho.

@qwcode
Copy link
Contributor

qwcode commented Feb 5, 2013

wow, fast turnaround, and new tests too.
I'll look at this closer in few days, but trying to handle immediate 1.3 issues.

if self.editable:
self.install_editable(install_options, global_options)
return

global_options += self.options.get('global_options', [])
install_options += self.options.get('install_options', [])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens when there's dupes or conflicts between the per-line options and the cli options?
this looks to be just sticking them together? is there some override logic somewhere I'm not seeing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, there's no explicit override logic. The last option given on the command line is the one that will be used. In our case requiremens.txt options will always override cmd options. Maybe I should reverse that?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my thought was that options in the requirements file should override.
that's going to be wanted more often I think... i.e. to add options in the req file for one troublesome requirement that should override general options in the cli.

worried it will somehow break down like this though. we're sure setuptools follows "last option given on the command line is the one that will be used" in all cases?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it makes sense in this case, even though command line arguments should typically trump all other sources.

It seems that last argument always wins (experimentally and from looking at the code). I'll add a comment to clarify this.

@gvalkov
Copy link
Contributor Author

gvalkov commented Mar 29, 2013

This branch has become unmergable after the work that went in to the wheel command. Rebasing and force pushing with develop 47edb6d.

@qwcode
Copy link
Contributor

qwcode commented Mar 29, 2013

added this tentatively to the "1.5" milestone.
trying to keep 1.4 on a tight leash to get it out asap.

@qwcode
Copy link
Contributor

qwcode commented Jan 3, 2014

btw, I never forgot about this PR. I think my block on this, was that I knew I wanted to break up req.py into a package right after merging it, and get your new module under that (and possibly restructure some of your code into a new RequirementsFile class). I would handle bringing this up to date and resolving conflicts, while maintaining your original commits. lotta people want this, so I get that's it important.

@qwcode
Copy link
Contributor

qwcode commented Jan 22, 2014

I knew I wanted to break up req.py into a package right after merging it

btw, the req.py breakup has been done, so getting this mergeable again will require a little work, and it might be hard to do with a merge and trying to maintain the original commits.

@qwcode
Copy link
Contributor

qwcode commented Jan 28, 2014

@gvalkov
the pypa-dev thread I mentioned. https://groups.google.com/forum/#!topic/pypa-dev/0zI8Jw-PYVk
there's definitely interest in "Requirements files 2.0", but if you're still wanting to get this updated for "Requirements 1.0", I'll help merge it.

@franciscoalves
Copy link

hi @qwcode, is there any way I can help you on this? I'd really like to see it working soon.

@msabramo
Copy link
Contributor

Too bad this had a bunch of work and then slipped through the cracks. I wonder if it could be resurrected.

@pfmoore
Copy link
Member

pfmoore commented Mar 11, 2015

Is the refactor necessary as part of this change? It would probably be easier to review if the refactor (code moves, no functionality change) and the new feature (functionality change but no code moves) were separate PRs.

@piotr-dobrogost
Copy link

@pfmoore

I think author's comment Reviewing by commit might be easier than going to 'Files Changed', imho. addresses exactly this concern.

@pfmoore
Copy link
Member

pfmoore commented Mar 11, 2015

@piotr-dobrogost Not really, it means "reviewing the whole PR may be hard" :-) If reviewing by commit is recommended, then a series of PRs that depend on each other may be more likely to get merged.

Anyhow, if I get time I'll review this, all I was saying is that it's less likely I'll get time to review the combined PR. (Personally, I don't find the github UI for reviewing by commit to be particularly easy to use, but that's just me).

@gvalkov
Copy link
Contributor Author

gvalkov commented Mar 11, 2015

Hello @pfmoore. Please hold that review for now. I'll start a new PR with a clean re-implementation of this feature, sans the extra refactoring.

@pfmoore
Copy link
Member

pfmoore commented Mar 11, 2015

@gvalkov Fantastic, thanks. I appreciate you putting in the extra work.

@msabramo
Copy link
Contributor

@gvalkov Thanks I appreciate it too. Can you post the PR here when you have it?

@gvalkov
Copy link
Contributor Author

gvalkov commented Mar 15, 2015

Hello @pfmoore and @msabramo. I just pushed PR #2537 and while I'm still looking into some of the build failures, I think it's ready to be scrutinized. It's a rebase and cleanup of the previous work that was done and as such contains a bit more refactoring than necessary.

Please consider #2537 with the req_file overhaul and if it turns out to be too risky or hard to review, I'll implement the change separately.

@qwcode
Copy link
Contributor

qwcode commented Apr 12, 2015

closed via #2537

@qwcode qwcode closed this Apr 12, 2015
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 4, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 4, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants