Skip to content

Separate pip freeze command from operation #2173

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

Merged
merged 1 commit into from
Dec 18, 2014

Conversation

msabramo
Copy link
Contributor

By extracting the logic into pip.operations.freeze, the hope is that folks could do a freeze programmatically more easily.

Inspired by #2150

@msabramo
Copy link
Contributor Author

Fixing merge conflict (conflicts with 5b817f9)...

@msabramo msabramo force-pushed the extract_freeze_operation branch from b9a6ad7 to 8954e29 Compare December 12, 2014 16:32
@msabramo
Copy link
Contributor Author

Fixed merge conflict with rebase to 8954e29.

@msabramo
Copy link
Contributor Author

Hmmm, Travis CI is going to fail, because the PyPy run ran out of disk space, which I am presuming is a Travis CI issue.

@msabramo
Copy link
Contributor Author

Someone want to restart https://travis-ci.org/pypa/pip/builds/43854252 ?

@pfmoore
Copy link
Member

pfmoore commented Dec 12, 2014

Done

@msabramo
Copy link
Contributor Author

Yay, the tests passed now! Thanks, @pfmoore!

@pfmoore, @dstufft: What do you guys think of this?

@xavfernandez
Copy link
Member

The idea of extracting the logic from commands is good. pip wheel, pip list or pip install could also benefit from such refactoring.
Currently other commands simply defined functions:
https://github.com/pypa/pip/blob/develop/pip/commands/show.py#L41
But the addition of pip.operations seems a nice idea to put all the operational logic.

@msabramo
Copy link
Contributor Author

@xavfernandez: Yeah I would also propose to do the same with other commands of course, though my thought was to do them in separate PRs. The reason for this is that changing a command like this is a big change so it's very easy for some other change to make the PR have merge conflicts. This is less likely to happen if I keep each PR focused on one command.

@dstufft
Copy link
Member

dstufft commented Dec 16, 2014

If we're going to do this, it'd probably be better to make pip.operations.freeze() return a string (or yield strings) and have the command itself handle outputting that to stdout.

@msabramo
Copy link
Contributor Author

I could rename get_freeze_lines to freeze and delete freeze_to_file.

What do you think?

@dstufft
Copy link
Member

dstufft commented Dec 16, 2014

Yea that sounds like a good path forward.

@msabramo msabramo force-pushed the extract_freeze_operation branch from 8954e29 to ef11ca9 Compare December 16, 2014 08:22
@msabramo
Copy link
Contributor Author

OK, rebased and updated to ef11ca9.

By extracting the logic into pip.operations.freeze, the hope is that
folks could do a freeze programmatically more easily.
@msabramo msabramo force-pushed the extract_freeze_operation branch from ef11ca9 to 0711744 Compare December 16, 2014 14:50
@msabramo
Copy link
Contributor Author

Updated to fix pep8 failure.

dstufft added a commit that referenced this pull request Dec 18, 2014
Separate pip freeze command from operation
@dstufft dstufft merged commit d60c1f4 into pypa:develop Dec 18, 2014
@msabramo
Copy link
Contributor Author

Interesting, I found a first example of someone using pip.operations.freeze in a project:

https://github.com/marksteve/pip-pin/blob/master/pip_pin.py#L3

msabramo added a commit to msabramo/pip that referenced this pull request Feb 7, 2015
By extracting the logic into pip.operations.list, the hope is that
folks could do a list programmatically more easily.

Continuing work started in pypa#2173
msabramo added a commit to msabramo/pip that referenced this pull request Feb 9, 2015
By extracting the logic into `pip.operations.search`, the hope is that
folks could do a `search` programmatically more easily.

It also has greater separation of concerns and should allow people to
work in parallel with less chance of merge conflicts.

Continuing work started in pypa#2173 and pypa#2404.
msabramo added a commit to msabramo/pip that referenced this pull request Feb 9, 2015
By extracting the logic into `pip.operations.search`, the hope is that
folks could do a `search` programmatically more easily.

It also has greater separation of concerns and should allow people to
work in parallel with less chance of merge conflicts.

Continuing work started in pypa#2173 and pypa#2404.
msabramo added a commit to msabramo/pip that referenced this pull request Feb 10, 2015
By extracting the logic into `pip.operations.search`, the hope is that
folks could do a `search` programmatically more easily.

It also has greater separation of concerns and should allow people to
work in parallel with less chance of merge conflicts.

Continuing work started in pypa#2173 and pypa#2404.
msabramo added a commit to msabramo/pip that referenced this pull request Feb 10, 2015
By extracting the logic into `pip.operations.wheel`, the hope is that
folks could do a `wheel` programmatically more easily.

It also has greater separation of concerns and should allow people to
work in parallel with less chance of merge conflicts.

Continuing work started in pypa#2173, pypa#2404, and pypa#2410.
msabramo added a commit to msabramo/pip that referenced this pull request Mar 5, 2015
By extracting the logic into `pip.operations.search`, the hope is that
folks could do a `search` programmatically more easily.

It also has greater separation of concerns and should allow people to
work in parallel with less chance of merge conflicts.

Continuing work started in pypa#2173 and pypa#2404.
msabramo added a commit to msabramo/pip that referenced this pull request Apr 14, 2015
By extracting the logic into `pip.operations.search`, the hope is that
folks could do a `search` programmatically more easily.

It also has greater separation of concerns and should allow people to
work in parallel with less chance of merge conflicts.

Continuing work started in pypa#2173 and pypa#2404.
@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.

4 participants