diff --git a/news/5235.doc.rst b/news/5235.doc.rst new file mode 100644 index 0000000000..54c3dd93c6 --- /dev/null +++ b/news/5235.doc.rst @@ -0,0 +1 @@ +Add documentation for environment variables the configure pipenv. diff --git a/pipenv/core.py b/pipenv/core.py index 7583e396eb..40021ee186 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -146,7 +146,8 @@ def load_dot_env(project, as_dict=False, quiet=False): err=True, ) dotenv.load_dotenv(dotenv_file, override=True) - project.s.initialize() + + project.s = environments.Setting() def cleanup_virtualenv(project, bare=True): diff --git a/pipenv/environments.py b/pipenv/environments.py index 7f1eb8bfae..7e08876203 100644 --- a/pipenv/environments.py +++ b/pipenv/environments.py @@ -107,19 +107,20 @@ def normalize_pipfile_path(p): class Setting: + """ + Control various settings of pipenv via environment variables. + """ + def __init__(self) -> None: - self.USING_DEFAULT_PYTHON = True - self.initialize() - def initialize(self): + self.USING_DEFAULT_PYTHON = True + """Use the default Python""" + #: Location for Pipenv to store it's package cache. + #: Default is to use appdir's user cache directory. self.PIPENV_CACHE_DIR = os.environ.get( "PIPENV_CACHE_DIR", user_cache_dir("pipenv") ) - """Location for Pipenv to store it's package cache. - - Default is to use appdir's user cache directory. - """ # Tells Pipenv which Python to default to, when none is provided. self.PIPENV_DEFAULT_PYTHON_VERSION = os.environ.get(