Skip to content

Commit 4f6d973

Browse files
committed
Refresh vendored dependencies.
1 parent b4b6bf7 commit 4f6d973

File tree

15 files changed

+2284
-0
lines changed

15 files changed

+2284
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pip
Lines changed: 319 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,319 @@
1+
Metadata-Version: 2.3
2+
Name: platformdirs
3+
Version: 4.2.2
4+
Summary: A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`.
5+
Project-URL: Documentation, https://platformdirs.readthedocs.io
6+
Project-URL: Homepage, https://github.com/platformdirs/platformdirs
7+
Project-URL: Source, https://github.com/platformdirs/platformdirs
8+
Project-URL: Tracker, https://github.com/platformdirs/platformdirs/issues
9+
Maintainer-email: Bernát Gábor <gaborjbernat@gmail.com>, Julian Berman <Julian@GrayVines.com>, Ofek Lev <oss@ofek.dev>, Ronny Pfannschmidt <opensource@ronnypfannschmidt.de>
10+
License-Expression: MIT
11+
License-File: LICENSE
12+
Keywords: appdirs,application,cache,directory,log,user
13+
Classifier: Development Status :: 5 - Production/Stable
14+
Classifier: Intended Audience :: Developers
15+
Classifier: License :: OSI Approved :: MIT License
16+
Classifier: Operating System :: OS Independent
17+
Classifier: Programming Language :: Python
18+
Classifier: Programming Language :: Python :: 3 :: Only
19+
Classifier: Programming Language :: Python :: 3.8
20+
Classifier: Programming Language :: Python :: 3.9
21+
Classifier: Programming Language :: Python :: 3.10
22+
Classifier: Programming Language :: Python :: 3.11
23+
Classifier: Programming Language :: Python :: 3.12
24+
Classifier: Programming Language :: Python :: Implementation :: CPython
25+
Classifier: Programming Language :: Python :: Implementation :: PyPy
26+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
27+
Requires-Python: >=3.8
28+
Provides-Extra: docs
29+
Requires-Dist: furo>=2023.9.10; extra == 'docs'
30+
Requires-Dist: proselint>=0.13; extra == 'docs'
31+
Requires-Dist: sphinx-autodoc-typehints>=1.25.2; extra == 'docs'
32+
Requires-Dist: sphinx>=7.2.6; extra == 'docs'
33+
Provides-Extra: test
34+
Requires-Dist: appdirs==1.4.4; extra == 'test'
35+
Requires-Dist: covdefaults>=2.3; extra == 'test'
36+
Requires-Dist: pytest-cov>=4.1; extra == 'test'
37+
Requires-Dist: pytest-mock>=3.12; extra == 'test'
38+
Requires-Dist: pytest>=7.4.3; extra == 'test'
39+
Provides-Extra: type
40+
Requires-Dist: mypy>=1.8; extra == 'type'
41+
Description-Content-Type: text/x-rst
42+
43+
The problem
44+
===========
45+
46+
.. image:: https://github.com/platformdirs/platformdirs/actions/workflows/check.yml/badge.svg
47+
:target: https://github.com/platformdirs/platformdirs/actions
48+
49+
When writing desktop application, finding the right location to store user data
50+
and configuration varies per platform. Even for single-platform apps, there
51+
may by plenty of nuances in figuring out the right location.
52+
53+
For example, if running on macOS, you should use::
54+
55+
~/Library/Application Support/<AppName>
56+
57+
If on Windows (at least English Win) that should be::
58+
59+
C:\Documents and Settings\<User>\Application Data\Local Settings\<AppAuthor>\<AppName>
60+
61+
or possibly::
62+
63+
C:\Documents and Settings\<User>\Application Data\<AppAuthor>\<AppName>
64+
65+
for `roaming profiles <https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-vista/cc766489(v=ws.10)>`_ but that is another story.
66+
67+
On Linux (and other Unices), according to the `XDG Basedir Spec`_, it should be::
68+
69+
~/.local/share/<AppName>
70+
71+
.. _XDG Basedir Spec: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
72+
73+
``platformdirs`` to the rescue
74+
==============================
75+
76+
This kind of thing is what the ``platformdirs`` package is for.
77+
``platformdirs`` will help you choose an appropriate:
78+
79+
- user data dir (``user_data_dir``)
80+
- user config dir (``user_config_dir``)
81+
- user cache dir (``user_cache_dir``)
82+
- site data dir (``site_data_dir``)
83+
- site config dir (``site_config_dir``)
84+
- user log dir (``user_log_dir``)
85+
- user documents dir (``user_documents_dir``)
86+
- user downloads dir (``user_downloads_dir``)
87+
- user pictures dir (``user_pictures_dir``)
88+
- user videos dir (``user_videos_dir``)
89+
- user music dir (``user_music_dir``)
90+
- user desktop dir (``user_desktop_dir``)
91+
- user runtime dir (``user_runtime_dir``)
92+
93+
And also:
94+
95+
- Is slightly opinionated on the directory names used. Look for "OPINION" in
96+
documentation and code for when an opinion is being applied.
97+
98+
Example output
99+
==============
100+
101+
On macOS:
102+
103+
.. code-block:: pycon
104+
105+
>>> from platformdirs import *
106+
>>> appname = "SuperApp"
107+
>>> appauthor = "Acme"
108+
>>> user_data_dir(appname, appauthor)
109+
'/Users/trentm/Library/Application Support/SuperApp'
110+
>>> site_data_dir(appname, appauthor)
111+
'/Library/Application Support/SuperApp'
112+
>>> user_cache_dir(appname, appauthor)
113+
'/Users/trentm/Library/Caches/SuperApp'
114+
>>> user_log_dir(appname, appauthor)
115+
'/Users/trentm/Library/Logs/SuperApp'
116+
>>> user_documents_dir()
117+
'/Users/trentm/Documents'
118+
>>> user_downloads_dir()
119+
'/Users/trentm/Downloads'
120+
>>> user_pictures_dir()
121+
'/Users/trentm/Pictures'
122+
>>> user_videos_dir()
123+
'/Users/trentm/Movies'
124+
>>> user_music_dir()
125+
'/Users/trentm/Music'
126+
>>> user_desktop_dir()
127+
'/Users/trentm/Desktop'
128+
>>> user_runtime_dir(appname, appauthor)
129+
'/Users/trentm/Library/Caches/TemporaryItems/SuperApp'
130+
131+
On Windows:
132+
133+
.. code-block:: pycon
134+
135+
>>> from platformdirs import *
136+
>>> appname = "SuperApp"
137+
>>> appauthor = "Acme"
138+
>>> user_data_dir(appname, appauthor)
139+
'C:\\Users\\trentm\\AppData\\Local\\Acme\\SuperApp'
140+
>>> user_data_dir(appname, appauthor, roaming=True)
141+
'C:\\Users\\trentm\\AppData\\Roaming\\Acme\\SuperApp'
142+
>>> user_cache_dir(appname, appauthor)
143+
'C:\\Users\\trentm\\AppData\\Local\\Acme\\SuperApp\\Cache'
144+
>>> user_log_dir(appname, appauthor)
145+
'C:\\Users\\trentm\\AppData\\Local\\Acme\\SuperApp\\Logs'
146+
>>> user_documents_dir()
147+
'C:\\Users\\trentm\\Documents'
148+
>>> user_downloads_dir()
149+
'C:\\Users\\trentm\\Downloads'
150+
>>> user_pictures_dir()
151+
'C:\\Users\\trentm\\Pictures'
152+
>>> user_videos_dir()
153+
'C:\\Users\\trentm\\Videos'
154+
>>> user_music_dir()
155+
'C:\\Users\\trentm\\Music'
156+
>>> user_desktop_dir()
157+
'C:\\Users\\trentm\\Desktop'
158+
>>> user_runtime_dir(appname, appauthor)
159+
'C:\\Users\\trentm\\AppData\\Local\\Temp\\Acme\\SuperApp'
160+
161+
On Linux:
162+
163+
.. code-block:: pycon
164+
165+
>>> from platformdirs import *
166+
>>> appname = "SuperApp"
167+
>>> appauthor = "Acme"
168+
>>> user_data_dir(appname, appauthor)
169+
'/home/trentm/.local/share/SuperApp'
170+
>>> site_data_dir(appname, appauthor)
171+
'/usr/local/share/SuperApp'
172+
>>> site_data_dir(appname, appauthor, multipath=True)
173+
'/usr/local/share/SuperApp:/usr/share/SuperApp'
174+
>>> user_cache_dir(appname, appauthor)
175+
'/home/trentm/.cache/SuperApp'
176+
>>> user_log_dir(appname, appauthor)
177+
'/home/trentm/.local/state/SuperApp/log'
178+
>>> user_config_dir(appname)
179+
'/home/trentm/.config/SuperApp'
180+
>>> user_documents_dir()
181+
'/home/trentm/Documents'
182+
>>> user_downloads_dir()
183+
'/home/trentm/Downloads'
184+
>>> user_pictures_dir()
185+
'/home/trentm/Pictures'
186+
>>> user_videos_dir()
187+
'/home/trentm/Videos'
188+
>>> user_music_dir()
189+
'/home/trentm/Music'
190+
>>> user_desktop_dir()
191+
'/home/trentm/Desktop'
192+
>>> user_runtime_dir(appname, appauthor)
193+
'/run/user/{os.getuid()}/SuperApp'
194+
>>> site_config_dir(appname)
195+
'/etc/xdg/SuperApp'
196+
>>> os.environ["XDG_CONFIG_DIRS"] = "/etc:/usr/local/etc"
197+
>>> site_config_dir(appname, multipath=True)
198+
'/etc/SuperApp:/usr/local/etc/SuperApp'
199+
200+
On Android::
201+
202+
>>> from platformdirs import *
203+
>>> appname = "SuperApp"
204+
>>> appauthor = "Acme"
205+
>>> user_data_dir(appname, appauthor)
206+
'/data/data/com.myApp/files/SuperApp'
207+
>>> user_cache_dir(appname, appauthor)
208+
'/data/data/com.myApp/cache/SuperApp'
209+
>>> user_log_dir(appname, appauthor)
210+
'/data/data/com.myApp/cache/SuperApp/log'
211+
>>> user_config_dir(appname)
212+
'/data/data/com.myApp/shared_prefs/SuperApp'
213+
>>> user_documents_dir()
214+
'/storage/emulated/0/Documents'
215+
>>> user_downloads_dir()
216+
'/storage/emulated/0/Downloads'
217+
>>> user_pictures_dir()
218+
'/storage/emulated/0/Pictures'
219+
>>> user_videos_dir()
220+
'/storage/emulated/0/DCIM/Camera'
221+
>>> user_music_dir()
222+
'/storage/emulated/0/Music'
223+
>>> user_desktop_dir()
224+
'/storage/emulated/0/Desktop'
225+
>>> user_runtime_dir(appname, appauthor)
226+
'/data/data/com.myApp/cache/SuperApp/tmp'
227+
228+
Note: Some android apps like Termux and Pydroid are used as shells. These
229+
apps are used by the end user to emulate Linux environment. Presence of
230+
``SHELL`` environment variable is used by Platformdirs to differentiate
231+
between general android apps and android apps used as shells. Shell android
232+
apps also support ``XDG_*`` environment variables.
233+
234+
235+
``PlatformDirs`` for convenience
236+
================================
237+
238+
.. code-block:: pycon
239+
240+
>>> from platformdirs import PlatformDirs
241+
>>> dirs = PlatformDirs("SuperApp", "Acme")
242+
>>> dirs.user_data_dir
243+
'/Users/trentm/Library/Application Support/SuperApp'
244+
>>> dirs.site_data_dir
245+
'/Library/Application Support/SuperApp'
246+
>>> dirs.user_cache_dir
247+
'/Users/trentm/Library/Caches/SuperApp'
248+
>>> dirs.user_log_dir
249+
'/Users/trentm/Library/Logs/SuperApp'
250+
>>> dirs.user_documents_dir
251+
'/Users/trentm/Documents'
252+
>>> dirs.user_downloads_dir
253+
'/Users/trentm/Downloads'
254+
>>> dirs.user_pictures_dir
255+
'/Users/trentm/Pictures'
256+
>>> dirs.user_videos_dir
257+
'/Users/trentm/Movies'
258+
>>> dirs.user_music_dir
259+
'/Users/trentm/Music'
260+
>>> dirs.user_desktop_dir
261+
'/Users/trentm/Desktop'
262+
>>> dirs.user_runtime_dir
263+
'/Users/trentm/Library/Caches/TemporaryItems/SuperApp'
264+
265+
Per-version isolation
266+
=====================
267+
268+
If you have multiple versions of your app in use that you want to be
269+
able to run side-by-side, then you may want version-isolation for these
270+
dirs::
271+
272+
>>> from platformdirs import PlatformDirs
273+
>>> dirs = PlatformDirs("SuperApp", "Acme", version="1.0")
274+
>>> dirs.user_data_dir
275+
'/Users/trentm/Library/Application Support/SuperApp/1.0'
276+
>>> dirs.site_data_dir
277+
'/Library/Application Support/SuperApp/1.0'
278+
>>> dirs.user_cache_dir
279+
'/Users/trentm/Library/Caches/SuperApp/1.0'
280+
>>> dirs.user_log_dir
281+
'/Users/trentm/Library/Logs/SuperApp/1.0'
282+
>>> dirs.user_documents_dir
283+
'/Users/trentm/Documents'
284+
>>> dirs.user_downloads_dir
285+
'/Users/trentm/Downloads'
286+
>>> dirs.user_pictures_dir
287+
'/Users/trentm/Pictures'
288+
>>> dirs.user_videos_dir
289+
'/Users/trentm/Movies'
290+
>>> dirs.user_music_dir
291+
'/Users/trentm/Music'
292+
>>> dirs.user_desktop_dir
293+
'/Users/trentm/Desktop'
294+
>>> dirs.user_runtime_dir
295+
'/Users/trentm/Library/Caches/TemporaryItems/SuperApp/1.0'
296+
297+
Be wary of using this for configuration files though; you'll need to handle
298+
migrating configuration files manually.
299+
300+
Why this Fork?
301+
==============
302+
303+
This repository is a friendly fork of the wonderful work started by
304+
`ActiveState <https://github.com/ActiveState/appdirs>`_ who created
305+
``appdirs``, this package's ancestor.
306+
307+
Maintaining an open source project is no easy task, particularly
308+
from within an organization, and the Python community is indebted
309+
to ``appdirs`` (and to Trent Mick and Jeff Rouse in particular) for
310+
creating an incredibly useful simple module, as evidenced by the wide
311+
number of users it has attracted over the years.
312+
313+
Nonetheless, given the number of long-standing open issues
314+
and pull requests, and no clear path towards `ensuring
315+
that maintenance of the package would continue or grow
316+
<https://github.com/ActiveState/appdirs/issues/79>`_, this fork was
317+
created.
318+
319+
Contributions are most welcome.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
platformdirs-4.2.2.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
2+
platformdirs-4.2.2.dist-info/METADATA,sha256=zmsie01G1MtXR0wgIv5XpVeTO7idr0WWvfmxKsKWuGk,11429
3+
platformdirs-4.2.2.dist-info/RECORD,,
4+
platformdirs-4.2.2.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5+
platformdirs-4.2.2.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
6+
platformdirs-4.2.2.dist-info/licenses/LICENSE,sha256=KeD9YukphQ6G6yjD_czwzv30-pSHkBHP-z0NS-1tTbY,1089
7+
platformdirs/__init__.py,sha256=EMGE8qeHRR9CzDFr8kL3tA8hdZZniYjXBVZd0UGTWK0,22225
8+
platformdirs/__main__.py,sha256=HnsUQHpiBaiTxwcmwVw-nFaPdVNZtQIdi1eWDtI-MzI,1493
9+
platformdirs/__pycache__/__init__.cpython-312.pyc,,
10+
platformdirs/__pycache__/__main__.cpython-312.pyc,,
11+
platformdirs/__pycache__/android.cpython-312.pyc,,
12+
platformdirs/__pycache__/api.cpython-312.pyc,,
13+
platformdirs/__pycache__/macos.cpython-312.pyc,,
14+
platformdirs/__pycache__/unix.cpython-312.pyc,,
15+
platformdirs/__pycache__/version.cpython-312.pyc,,
16+
platformdirs/__pycache__/windows.cpython-312.pyc,,
17+
platformdirs/android.py,sha256=xZXY9Jd46WOsxT2U6-5HsNtDZ-IQqxcEUrBLl3hYk4o,9016
18+
platformdirs/api.py,sha256=QBYdUac2eC521ek_y53uD1Dcq-lJX8IgSRVd4InC6uc,8996
19+
platformdirs/macos.py,sha256=wftsbsvq6nZ0WORXSiCrZNkRHz_WKuktl0a6mC7MFkI,5580
20+
platformdirs/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21+
platformdirs/unix.py,sha256=Cci9Wqt35dAMsg6HT9nRGHSBW5obb0pR3AE1JJnsCXg,10643
22+
platformdirs/version.py,sha256=r7F76tZRjgQKzrpx_I0_ZMQOMU-PS7eGnHD7zEK3KB0,411
23+
platformdirs/windows.py,sha256=IFpiohUBwxPtCzlyKwNtxyW4Jk8haa6W8o59mfrDXVo,10125

setuptools/_vendor/platformdirs-4.2.2.dist-info/REQUESTED

Whitespace-only changes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Wheel-Version: 1.0
2+
Generator: hatchling 1.24.2
3+
Root-Is-Purelib: true
4+
Tag: py3-none-any
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2010-202x The platformdirs developers
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)