Skip to content

Trim unused pygments formatters and CLI #13337

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
Apr 19, 2025

Conversation

ichard26
Copy link
Member

@ichard26 ichard26 commented Apr 15, 2025

The formatters are exclusively used by the pygments CLI which is already broken because it depends on lexers we've trimmed a long time ago.

~/dev/oss/pip ❯ python -m pip._vendor.pygments
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/ichard26/dev/oss/pip/src/pip/_vendor/pygments/__main__.py", line 12, in <module>
    from pip._vendor.pygments.cmdline import main
  File "/home/ichard26/dev/oss/pip/src/pip/_vendor/pygments/cmdline.py", line 23, in <module>
    from pip._vendor.pygments.lexers.special import TextLexer
ModuleNotFoundError: No module named 'pip._vendor.pygments.lexers.special'

For context: while rich is great and it makes improving our CLI output much easier, we were never happy with how it ballooned the size of our vendored dependencies.

The formatters are exclusively used by the pygments CLI which is already
broken because it depends on lexers we've trimmed a long time ago.
@ichard26 ichard26 added skip news Does not need a NEWS file entry (eg: trivial changes) project: vendored dependency Related to a vendored dependency labels Apr 15, 2025
@ichard26 ichard26 added this to the 25.1 milestone Apr 17, 2025
@pfmoore
Copy link
Member

pfmoore commented Apr 19, 2025

I merged the vendoring updates for 25.1 to ensure this won't have merge conflicts.

@ichard26 ichard26 merged commit d14ace5 into pypa:main Apr 19, 2025
29 checks passed
@ichard26 ichard26 deleted the removal/trim-pygments branch April 19, 2025 13:39
@ichard26
Copy link
Member Author

Thanks for the reviews @pfmoore and @pradyunsg !

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
project: vendored dependency Related to a vendored dependency 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.

3 participants