isort icon indicating copy to clipboard operation
isort copied to clipboard

Importing isort breaks Rich

Open ofek opened this issue 2 years ago • 0 comments

from rich.console import Console
from rich.markdown import Markdown

MARKDOWN = """\
```python
from pathlib import Path

import httpx


def download(path: Path, *args, **kwargs):
    with httpx.stream('GET', *args, **kwargs) as response:
        response.raise_for_status()

        with path.open(mode='wb', buffering=0) as f:
            for chunk in response.iter_bytes(16384):
                f.write(chunk)
```
"""


def main():
    # Comment this out
    import isort

    Console().print(Markdown(MARKDOWN))


if __name__ == '__main__':
    main()

ofek avatar Aug 03 '22 18:08 ofek