Skip to content

Conversation

CortexShadow
Copy link
Contributor

Summary
Improves the documentation for pip freeze --all by adding a clear explanatory note and a before/after example. This is a documentation-only change; no behavior is modified.

Motivation
The current description of --all can be misread and leaves ambiguity about which packages are shown. By making it explicit that pip, setuptools, and wheel are skipped by default—and included with --all—the docs now provide a more accurate and practical mental model for users.

Changes

  • Added a .. note:: clarifying default behavior and the effect of --all.
  • Introduced Unix and Windows examples comparing pip freeze vs. pip freeze --all.
  • Kept the style consistent with the CLI reference page.

Notes

  • Local linters, pre-commit hooks, targeted freeze tests, and the Sphinx docs build all pass.
  • No changelog/news entry is required since this is docs-only.

Related
Closes #13557

@notatallshaw
Copy link
Member

Hi @CoretexShadow thanks for submitting this PR to pip!

All pip maintainers currently operate on a volunteer basis, so it can take some time for one of to take a look and review a PR. I will try and make some time soon to review this PR though.

@sepehr-rs
Copy link
Collaborator

Hi @CortexShadow, thanks a lot for contributing to pip!
I’m not on the triage team yet, so I can’t formally approve, but I checked the updated docs and they’re consistent with pip’s behavior. This looks good to me!

@CortexShadow
Copy link
Contributor Author

Hi @CortexShadow, thanks a lot for contributing to pip! I’m not on the triage team yet, so I can’t formally approve, but I checked the updated docs and they’re consistent with pip’s behavior. This looks good to me!

Thanks for checking this and confirming! Really appreciate your feedback.

Copy link
Member

@ichard26 ichard26 left a comment

Choose a reason for hiding this comment

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

Hi, thanks for your interest in improving pip!

While I agree we could document pip freeze --all better, we can probably simplify how we go about that. It's likely a very uncommon option. Short and sweet is best.

Sorry for the long wait!

Comment on lines 32 to 39
.. note::

By default, ``pip freeze`` omits some bootstrap tooling so the output focuses on
your project’s dependencies. In Python **3.11 and earlier**, this means ``pip``,
``setuptools`` and ``wheel`` are skipped by default; in Python **3.12 and later**,
only ``pip`` is skipped. Use ``--all`` to include those entries as well when you
need a complete environment snapshot. Note that ``pip freeze`` reports what is
installed—it does **not** compute a lockfile or a solver result.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
.. note::
By default, ``pip freeze`` omits some bootstrap tooling so the output focuses on
your project’s dependencies. In Python **3.11 and earlier**, this means ``pip``,
``setuptools`` and ``wheel`` are skipped by default; in Python **3.12 and later**,
only ``pip`` is skipped. Use ``--all`` to include those entries as well when you
need a complete environment snapshot. Note that ``pip freeze`` reports what is
installed—it does **not** compute a lockfile or a solver result.
.. note::
By default, ``pip freeze`` omits some bootstrap tooling so the output focuses on
your project’s dependencies. On Python **3.11 and earlier**, this means ``pip``,
``setuptools`` and ``wheel`` are skipped by default; on Python **3.12 and later**,
only ``pip`` is skipped. Use ``--all`` to include those packages as well when you
need a complete environment snapshot. Note that ``pip freeze`` reports what is
installed—it does **not** compute a lockfile or a solver result.

Copy link
Member

Choose a reason for hiding this comment

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

Also, on Python 3.11 and lower, distribute is also ignored.

env1\bin\python -m pip freeze > requirements.txt
env2\bin\python -m pip install -r requirements.txt
#. Compare default output with ``--all``.
Copy link
Member

Choose a reason for hiding this comment

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

To be honest, I don't think we gain much from including an example. It's predictable what --all will do given the note you added earlier. I suspect --all is very rarely used, so IMO it doesn't warrant an example.


.. pip-command-options:: freeze

.. note::
Copy link
Member

Choose a reason for hiding this comment

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

I think this would be more useful if it was moved up to be at the end of the "Description" section

Image

Copy link
Member

Choose a reason for hiding this comment

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

We should really make this clearer in the contributing docs, but we only add changelog entries for documentation changes when the changes are major (like restructuring a large portion).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should really make this clearer in the contributing docs, but we only add changelog entries for documentation changes when the changes are major (like restructuring a large portion).

Thanks for the review! I’ve applied the requested changes, and I agree that no changelog entry is needed for these minor documentation updates. I’ve removed the unnecessary example, clarified the --all option, and moved the note as suggested.

@CortexShadow CortexShadow requested a review from ichard26 October 13, 2025 17:49
@ichard26 ichard26 added the skip news Does not need a NEWS file entry (eg: trivial changes) label Oct 13, 2025
Copy link
Member

@ichard26 ichard26 left a comment

Choose a reason for hiding this comment

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

Thank you!

@ichard26 ichard26 merged commit 758a172 into pypa:main Oct 13, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided skip news Does not need a NEWS file entry (eg: trivial changes)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clarify pip freeze --all documentation at pip.pypa.io

4 participants