-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Add "color" install extra #7683
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
Comments
Related to #7132 as well. |
iirc the plan of record is to make pygments a normal dependency of pytest, the syntax coloring right now is considered experimental |
@asottile is correct: it is experimental at the moment and we're not 100% sure we will go with pygments just yet, that's why also there's no option to configure styles. Because it is uncertain, I would not like to add an extra just now because extras can be considered part of the public API. |
With pytest 7 out it seems that Pygments-based coloring is now less of an experimental feature – would it perhaps make sense to consider adding it to the list of regular requirements (or as an extra if the opt-in route is preferred)? |
It has been some years now and I we don't have plans to move away from I think the safest approach is to add it as an It would be great if anyone could contribute a PR with that. 👍 |
Is that really as much as a problem as it used to be in previous years, and if so, can we do something about that? For what it's worth, we already are in the same situation for exceptiongroup, packaging and (maybe to a lesser extent, as under our control) iniconfig and pluggy. We also were in the same situation with attrs, and from what I can see in #10669 this never was an argument (at least when removing it). |
Oh, and as for why it IMHO shouldn't be an optional dependency:
|
Thanks @The-Compiler, good points about this already being a problem for That said then I'm OK with just adding |
Opened #13189 to turn it into a regular dependency. |
Personally I have projects which want minimal dependencies so I appreciate that pygments is optional. But I understand that the way it's currently done is not ideal, so I support making it a required dependency. Hopefully if Python packaging gains the ability to have "default extras" we could switch to that - add a |
I can see wanting to have minimal direct dependencies, and I can see wanting to have minimal runtime dependencies. I think for a transitive dependency that's also development-only, it might be less of an issue?
That would be cool! From looking at python/peps#4198 that's only some 2-3 weeks old, but it would definitely make this kind of thing easier! |
Allowing the user to install color support through an install extra (e.g.
pip install pytest[color]
) would be nicer than requiring that a random package be placed in the long list of requirements, I think.It should be quite straightforward to implement this (see https://setuptools.readthedocs.io/en/latest/setuptools.html#declaring-extras-optional-features-with-their-own-dependencies).
The text was updated successfully, but these errors were encountered: