Skip to content

Commit

Permalink
Depend on 'colorama' on Windows to fix color output in terminal (#2606)
Browse files Browse the repository at this point in the history
Adding the explicit dependency, because

1. 'click' prior to v8.0 did not have this dependency, it was used "only if present"
2. We *are* importing it, let's declare it as such
  • Loading branch information
oprypin committed Oct 11, 2021
1 parent e579117 commit ba83f90
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mkdocs/__main__.py
Expand Up @@ -12,6 +12,15 @@
from mkdocs import config
from mkdocs.commands import build, gh_deploy, new, serve


if sys.platform.startswith("win"):
try:
import colorama
except ImportError:
pass
else:
colorama.init()

log = logging.getLogger(__name__)


Expand Down
1 change: 1 addition & 0 deletions requirements/project-min.txt
Expand Up @@ -12,3 +12,4 @@ mkdocs-redirects==1.0.1
importlib_metadata==3.10.0
packaging==20.5
mergedeep==1.3.4
colorama==0.4; platform_system == 'Windows'
1 change: 1 addition & 0 deletions requirements/project.txt
Expand Up @@ -12,3 +12,4 @@ mkdocs-redirects>=1.0.1
importlib_metadata>=3.10
packaging>=20.5
mergedeep>=1.3.4
colorama>=0.4; platform_system == 'Windows'

0 comments on commit ba83f90

Please sign in to comment.