Skip to content

Commit 0b0ae61

Browse files
build: switch from appdirs to platformdirs
appdirs has been officially deprecated upstream, the replacement module with more features is platformdirs. Closes #2028
1 parent 67303b8 commit 0b0ae61

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

CHANGES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Pint Changelog
88
- Added mu and mc as alternatives for SI micro prefix
99
- Added ℓ as alternative for liter
1010
- Support permille units and `‰` symbol (PR #2033, Issue #1963)
11+
- Switch from appdirs to platformdirs.
1112

1213

1314
0.24.1 (2024-06-24)

docs/advanced/performance.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ If you want to use the default cache folder provided by the OS, use **:auto:**
120120
>>> import pint
121121
>>> ureg = pint.UnitRegistry(cache_folder=":auto:") # doctest: +SKIP
122122
123-
Pint use an included version of appdirs_ to obtain the correct folder,
123+
Pint use an external dependency of platformdirs_ to obtain the correct folder,
124124
for example in macOS is `/Users/<username>/Library/Caches/pint`
125125

126126
In any case, you can check the location of the cache folder.
@@ -146,5 +146,5 @@ In any case, you can check the location of the cache folder.
146146

147147

148148
.. _`brentq method`: http://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.brentq.html
149-
.. _appdirs: https://pypi.org/project/appdirs/
149+
.. _platformdirs: https://pypi.org/project/platformdirs
150150
.. _flexcache: https://github.com/hgrecco/flexcache/

pint/facets/plain/registry.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
# from ..._typing import Quantity, Unit
5151

52-
import appdirs
52+
import platformdirs
5353

5454
from ... import pint_eval
5555
from ..._typing import (
@@ -238,8 +238,7 @@ def __init__(
238238
self._init_dynamic_classes()
239239

240240
if cache_folder == ":auto:":
241-
cache_folder = appdirs.user_cache_dir(appname="pint", appauthor=False)
242-
cache_folder = pathlib.Path(cache_folder)
241+
cache_folder = platformdirs.user_cache_path(appname="pint", appauthor=False)
243242

244243
from ... import delegates # TODO: change thiss
245244

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
appdirs>=1.4.4
1+
platformdirs>=2.1.0
22
typing_extensions>=4.0.0
33
flexcache>=0.3
44
flexparser>=0.3

0 commit comments

Comments
 (0)