Skip to content

Sort "pip freeze" results by name #1602

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
giampaolo opened this issue Feb 27, 2014 · 7 comments
Closed

Sort "pip freeze" results by name #1602

giampaolo opened this issue Feb 27, 2014 · 7 comments
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@giampaolo
Copy link

This is a feature request.
Unless there are good reasons not to do it, I think it makes sense to have ordered package names.

@Ivoz
Copy link
Contributor

Ivoz commented Feb 27, 2014

@giampaolo
Copy link
Author

Maybe that is just in the development version?

(httpbench)giampaolo@UX32VD:~/svn/samsung/httpbench$ pip  --version
pip 1.5.4 from /home/giampaolo/svn/samsung/httpbench/_venv/local/lib/python2.7/site-packages (python 2.7)
(httpbench)giampaolo@UX32VD:~/svn/samsung/httpbench$ pip freeze 
PyYAML==3.10
argparse==1.2.1
docopt==0.6.1
httpbench==0.1
ipdb==0.8
ipython==1.2.1
-e hg+https://code.google.com/p/psutil@f251d96aa3f99b4bfd403e2de7360af5d7566222#egg=psutil-dev
requests==2.2.1
wsgiref==0.1.2

@Ivoz
Copy link
Contributor

Ivoz commented Feb 27, 2014

No, been around for a while. If you think it should use a different key comparison, please say so so we can consider.

@giampaolo
Copy link
Author

Are you able to reproduce the issue though?

@Ivoz
Copy link
Contributor

Ivoz commented Feb 27, 2014

Which issue? As in normal python string comparison, capital letters come before lowercase. e.g:

(cryptography)ivo@ivosung cryptography (master)$ pip freeze
Jinja2==2.7.2
MarkupSafe==0.18
Pygments==1.6
Sphinx==1.2.1
cffi==0.8.1
cov-core==1.7
coverage==3.7.1
-e [email protected]:Ivoz/cryptography.git@bd08799bcce99b94250ad3b3313826651c8c0181#egg=cryptography-pyca/master
docutils==0.11
enum34==0.9.23
flake8==2.1.0
mccabe==0.2.1
pep8==1.4.6
pretend==1.0.7
py==1.4.20
pycparser==2.10
pyflakes==0.7.3
pytest==2.5.2
pytest-cov==1.6
six==1.5.2
tox==1.7.0
virtualenv==1.11.4
wheel==0.22.0
wsgiref==0.1.2

Everything sorted alphabetically

@giampaolo
Copy link
Author

Mmm you're right, I clearly got confused, sorry.
But yes, I'd like to propose a change in order to avoid having capital letters visually separated from others as in:

>>> sorted(ls, key=lambda x: x.lower()))

This way we'd also have "-e " lines at the top of the list instead of in the middle.
This is going to be the result which IMO is more readable:

-e [email protected]:Ivoz/cryptography.git@bd08799bcce99b94250ad3b3313826651c8c0181#egg=cryptography-pyca/master
cffi==0.8.1
cov-core==1.7
coverage==3.7.1
docutils==0.11
enum34==0.9.23
flake8==2.1.0
Jinja2==2.7.2
MarkupSafe==0.18
mccabe==0.2.1
pep8==1.4.6
pretend==1.0.7
py==1.4.20
pycparser==2.10
pyflakes==0.7.3
Pygments==1.6
pytest-cov==1.6
pytest==2.5.2
six==1.5.2
Sphinx==1.2.1
tox==1.7.0
virtualenv==1.11.4
wheel==0.22.0
wsgiref==0.1.2

@giampaolo
Copy link
Author

thanks

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 5, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 5, 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

No branches or pull requests

2 participants