diff --git a/HISTORY.txt b/HISTORY.txt index 58cb8d11..b5dadac0 100644 --- a/HISTORY.txt +++ b/HISTORY.txt @@ -1,3 +1,5 @@ +unreleased: +- Disable spinner by setting PIPENV_NOSPIN=1 environment variable. 3.3.4: - Fix PIPENV_VENV_IN_PROJECT mode. - Fix PIPENV_SHELL_COMPAT mode. diff --git a/docs/advanced.rst b/docs/advanced.rst index 6a64fb60..a1b8fa3d 100644 --- a/docs/advanced.rst +++ b/docs/advanced.rst @@ -91,6 +91,8 @@ will detect it. - ``PIPENV_COLORBLIND`` — Disable terminal colors, for some reason. + - ``PIPENV_NOSPIN`` — Disable terminal spinner, for cleaner logs. + - ``PIPENV_MAX_DEPTH`` — Set to an integer for the maximum number of directories to search for a Pipfile. diff --git a/pipenv/cli.py b/pipenv/cli.py index 3a6cfd10..56e4d5fc 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -23,7 +23,7 @@ from .project import Project from .utils import convert_deps_from_pip, convert_deps_to_pip, is_required_version from .__version__ import __version__ from . import pep508checker -from .environments import PIPENV_COLORBLIND, PIPENV_SHELL_COMPAT, PIPENV_VENV_IN_PROJECT +from .environments import PIPENV_COLORBLIND, PIPENV_NOSPIN, PIPENV_SHELL_COMPAT, PIPENV_VENV_IN_PROJECT try: from HTMLParser import HTMLParser @@ -49,6 +49,13 @@ click_completion.init() if PIPENV_COLORBLIND: crayons.disable() +# Disable spinner, for cleaner build logs. +if PIPENV_NOSPIN: + import contextlib + @contextlib.contextmanager + def spinner(): + yield + # Disable warnings for Python 2.6. requests.packages.urllib3.disable_warnings(InsecureRequestWarning) diff --git a/pipenv/environments.py b/pipenv/environments.py index d30fda02..f8924eb1 100644 --- a/pipenv/environments.py +++ b/pipenv/environments.py @@ -15,6 +15,9 @@ PIPENV_VENV_IN_PROJECT = os.environ.get('PIPENV_VENV_IN_PROJECT') # No color mode, for unfun people. PIPENV_COLORBLIND = os.environ.get('PIPENV_COLORBLIND') +# Disable spinner for better test and deploy logs. +PIPENV_NOSPIN = os.environ.get('PIPENV_NOSPIN') + # User-configuraable max-depth for Pipfile searching. # Note: +1 because of a bug in Pipenv. PIPENV_MAX_DEPTH = int(os.environ.get('PIPENV_MAX_DEPTH', '3')) + 1