Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document all environment variables #5235

Merged
merged 3 commits into from
Aug 8, 2022
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
1 change: 1 addition & 0 deletions news/5235.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add documentation for environment variables the configure pipenv.
3 changes: 2 additions & 1 deletion pipenv/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
15 changes: 8 additions & 7 deletions pipenv/environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down