-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Lazily load pygments styles #1211
Comments
Command:
Since the actual load we are removing is |
(I'll send a patch after #1200) |
Nice! Could we do some quick lookup even if the user specifies The full list is probably only needed for |
If users specify
There is actually no cost distinction between the names of the styles and the loading of actual lexers, since most of the time is spent on the
|
Couldn’t we use a different method for checking if it exists (e.g. checking if a module exists first, and only then loading the styles if not)? If I use a custom |
We could introduce layers (e.g Another possibility is asking pygments maintainers whether they would accept a patch that migrates from |
We currently try to retrieve all pygments styles at once, but this operation is very slow due to the import of
pkg_resources
on the pygments side.https://github.com/httpie/httpie/blob/cfcd7413d1afbabc5ab3c88a892851335be4944a/httpie/output/formatters/colors.py#L31
We should load these styles lazily when a user specifies
--style
explicitly.The text was updated successfully, but these errors were encountered: