rich icon indicating copy to clipboard operation
rich copied to clipboard

[REQUEST] Add a [minimal] version of rich without commonmark and pygments

Open tonybaloney opened this issue 3 years ago • 5 comments

Rich comes with 2 required dependencies: commonmark and pygments.

CommonMark for Markdown parsing and rendering. Pygments for code syntax highlighting.

I'm often pulling in rich for colorised outputs, tables, and progress bars. None of these require those libs.

It would be nice to have a "minimal" version of rich that doesn't itself have dependencies, e.g.:

$ pip install rich[minimal]

Thanks for your consideration

tonybaloney avatar May 16 '22 03:05 tonybaloney

I've had the same point myself, but AFAIK the extras can't subtract dependencies, only add them.

An alternative might be to have a new package called rich-minimal.

willmcgugan avatar May 16 '22 10:05 willmcgugan

Or second option is to rewrite rich and setup.py to optionally install syntax highlight and markdown render

USLTD avatar May 17 '22 12:05 USLTD

That's not an option, since it will break people's code.

willmcgugan avatar May 17 '22 13:05 willmcgugan

@willmcgugan I have a question. Why don't vendor every dependency rich has locally? It would reduce size since it would be possible to remove unwanted functions and variables.

USLTD avatar May 17 '22 13:05 USLTD

@willmcgugan one solution is using env variable in setup.py to control the "subtracted" dependency, example

https://github.com/jina-ai/jina/blob/c056fad074ae6f46a61b193fd89af6b7f0751be8/setup.py#L135

hanxiao avatar Jul 16 '22 16:07 hanxiao

any env variables are no options as wheels no longer evaluate them

additionally ipywidgets is impending adoption to https://github.com/entangled/entangled.py/issues/7

RonnyPfannschmidt avatar Aug 02 '23 12:08 RonnyPfannschmidt