Add PIPENV_NOSPIN option for cleaner build logs

This commit is contained in:
Jace Browning
2017-02-02 13:02:21 -05:00
parent 7513955206
commit 3b0c2b54df
4 changed files with 15 additions and 1 deletions
+2
View File
@@ -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.
+2
View File
@@ -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.
+8 -1
View File
@@ -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)
+3
View File
@@ -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