Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
pip._internal.utils.appdirs Namespace Reference

Functions

str user_cache_dir (str appname)
 
str _macos_user_config_dir (str appname, bool roaming=True)
 
str user_config_dir (str appname, bool roaming=True)
 
List[str] site_config_dirs (str appname)
 

Detailed Description

This code wraps the vendored appdirs module to so the return values are
compatible for the current pip code base.

The intention is to rewrite current usages gradually, keeping the tests pass,
and eventually drop this after all usages are changed.

Function Documentation

◆ _macos_user_config_dir()

str _macos_user_config_dir ( str  appname,
bool   roaming = True 
)
protected

Definition at line 20 of file appdirs.py.

20def _macos_user_config_dir(appname: str, roaming: bool = True) -> str:
21 # Use ~/Application Support/pip, if the directory exists.
22 path = _appdirs.user_data_dir(appname, appauthor=False, roaming=roaming)
23 if os.path.isdir(path):
24 return path
25
26 # Use a Linux-like ~/.config/pip, by default.
27 linux_like_path = "~/.config/"
28 if appname:
29 linux_like_path = os.path.join(linux_like_path, appname)
30
31 return os.path.expanduser(linux_like_path)
32
33
for i

References i.

Referenced by pip._internal.utils.appdirs.user_config_dir().

Here is the caller graph for this function:

◆ site_config_dirs()

List[str] site_config_dirs ( str  appname)

Definition at line 43 of file appdirs.py.

43def site_config_dirs(appname: str) -> List[str]:
44 if sys.platform == "darwin":
45 return [_appdirs.site_data_dir(appname, appauthor=False, multipath=True)]
46
47 dirval = _appdirs.site_config_dir(appname, appauthor=False, multipath=True)
48 if sys.platform == "win32":
49 return [dirval]
50
51 # Unix-y system. Look in /etc as well.
52 return dirval.split(os.pathsep) + ["/etc"]

References i.

◆ user_cache_dir()

str user_cache_dir ( str  appname)

Definition at line 16 of file appdirs.py.

16def user_cache_dir(appname: str) -> str:
17 return _appdirs.user_cache_dir(appname, appauthor=False)
18
19

References i.

◆ user_config_dir()

str user_config_dir ( str  appname,
bool   roaming = True 
)

Definition at line 34 of file appdirs.py.

34def user_config_dir(appname: str, roaming: bool = True) -> str:
35 if sys.platform == "darwin":
36 return _macos_user_config_dir(appname, roaming)
37
38 return _appdirs.user_config_dir(appname, appauthor=False, roaming=roaming)
39
40
41# for the discussion regarding site_config_dir locations
42# see <https://github.com/pypa/pip/issues/1733>

References pip._internal.utils.appdirs._macos_user_config_dir(), and i.

Here is the call graph for this function: