Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pipenv/environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,15 +425,15 @@ def is_using_venv() -> bool:
return result


def is_in_virtualenv():
def is_in_virtualenv() -> bool:
"""
Check virtualenv membership dynamically

:return: True or false depending on whether we are in a regular virtualenv or not
:return: True or False depending on whether we are in a regular virtualenv or not
:rtype: bool
"""

pipenv_active = os.environ.get("PIPENV_ACTIVE", False)
pipenv_active = os.environ.get("PIPENV_ACTIVE")
virtual_env = bool(os.environ.get("VIRTUAL_ENV"))
ignore_virtualenvs = bool(get_from_env("IGNORE_VIRTUALENVS"))
return virtual_env and not (pipenv_active or ignore_virtualenvs)
Expand Down
7 changes: 2 additions & 5 deletions pipenv/utils/pip.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,5 @@ def get_pip_args(
return list(dict.fromkeys(arg_set))


def get_trusted_hosts():
try:
return os.environ.get("PIP_TRUSTED_HOSTS", []).split(" ")
except AttributeError:
return []
def get_trusted_hosts() -> List[str]:
return os.environ.get("PIP_TRUSTED_HOSTS", "").split()