Skip to content

Commit 0981e07

Browse files
authored
Merge pull request #10539 from pradyunsg/vendoring-upgrade
2 parents 3bbf6e9 + 65c3f54 commit 0981e07

29 files changed

+400
-110
lines changed

news/appdirs.vendor.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove appdirs as a vendored dependency.

news/c8285e11-5b65-498c-9eaa-85ca096243f9.vendor.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.
File renamed without changes.

news/distro.vendor.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Upgrade distro to 1.6.0

news/ecb79d5a-46b6-4e7b-8ee8-561c9aac697b.vendor.rst

Whitespace-only changes.

news/platformdirs.vendor.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Patch platformdirs import its submodules from ``pip._vendor.platformdirs``.
1+
Add platformdirs as a vendored dependency.

news/progress.vendor.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Upgrade progress to 1.6

news/urllib3.vendor.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Upgrade urllib3 to 1.26.7

src/pip/_vendor/platformdirs/__init__.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,29 @@ def user_log_dir(
144144
return PlatformDirs(appname=appname, appauthor=appauthor, version=version, opinion=opinion).user_log_dir
145145

146146

147+
def user_documents_dir() -> str:
148+
"""
149+
:returns: documents directory tied to the user
150+
"""
151+
return PlatformDirs().user_documents_dir
152+
153+
154+
def user_runtime_dir(
155+
appname: Optional[str] = None,
156+
appauthor: Union[str, None, "Literal[False]"] = None,
157+
version: Optional[str] = None,
158+
opinion: bool = True,
159+
) -> str:
160+
"""
161+
:param appname: See `appname <platformdirs.api.PlatformDirsABC.appname>`.
162+
:param appauthor: See `appauthor <platformdirs.api.PlatformDirsABC.appauthor>`.
163+
:param version: See `version <platformdirs.api.PlatformDirsABC.version>`.
164+
:param opinion: See `opinion <platformdirs.api.PlatformDirsABC.opinion>`.
165+
:returns: runtime directory tied to the user
166+
"""
167+
return PlatformDirs(appname=appname, appauthor=appauthor, version=version, opinion=opinion).user_runtime_dir
168+
169+
147170
def user_data_path(
148171
appname: Optional[str] = None,
149172
appauthor: Union[str, None, "Literal[False]"] = None,
@@ -256,6 +279,29 @@ def user_log_path(
256279
return PlatformDirs(appname=appname, appauthor=appauthor, version=version, opinion=opinion).user_log_path
257280

258281

282+
def user_documents_path() -> Path:
283+
"""
284+
:returns: documents path tied to the user
285+
"""
286+
return PlatformDirs().user_documents_path
287+
288+
289+
def user_runtime_path(
290+
appname: Optional[str] = None,
291+
appauthor: Union[str, None, "Literal[False]"] = None,
292+
version: Optional[str] = None,
293+
opinion: bool = True,
294+
) -> Path:
295+
"""
296+
:param appname: See `appname <platformdirs.api.PlatformDirsABC.appname>`.
297+
:param appauthor: See `appauthor <platformdirs.api.PlatformDirsABC.appauthor>`.
298+
:param version: See `version <platformdirs.api.PlatformDirsABC.version>`.
299+
:param opinion: See `opinion <platformdirs.api.PlatformDirsABC.opinion>`.
300+
:returns: runtime path tied to the user
301+
"""
302+
return PlatformDirs(appname=appname, appauthor=appauthor, version=version, opinion=opinion).user_runtime_path
303+
304+
259305
__all__ = [
260306
"__version__",
261307
"__version_info__",
@@ -267,13 +313,17 @@ def user_log_path(
267313
"user_cache_dir",
268314
"user_state_dir",
269315
"user_log_dir",
316+
"user_documents_dir",
317+
"user_runtime_dir",
270318
"site_data_dir",
271319
"site_config_dir",
272320
"user_data_path",
273321
"user_config_path",
274322
"user_cache_path",
275323
"user_state_path",
276324
"user_log_path",
325+
"user_documents_path",
326+
"user_runtime_path",
277327
"site_data_path",
278328
"site_config_path",
279329
]

src/pip/_vendor/platformdirs/__main__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
"user_cache_dir",
77
"user_state_dir",
88
"user_log_dir",
9+
"user_documents_dir",
10+
"user_runtime_dir",
911
"site_data_dir",
1012
"site_config_dir",
1113
)

0 commit comments

Comments
 (0)