File: platformdirs.patch

package info (click to toggle)
python-fs 2.4.16-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,060 kB
  • sloc: python: 13,155; makefile: 226; sh: 3
file content (96 lines) | stat: -rw-r--r-- 3,576 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
From: Debian Python Team <team+python@tracker.debian.org>
Date: Sun, 7 Sep 2025 18:50:49 +0200
Subject: platformdirs

===================================================================
---
 fs/appfs.py          | 4 ++--
 setup.cfg            | 2 +-
 tests/test_appfs.py  | 7 +++----
 tests/test_opener.py | 6 +++---
 4 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/fs/appfs.py b/fs/appfs.py
index ef77295..86ff9c9 100644
--- a/fs/appfs.py
+++ b/fs/appfs.py
@@ -12,7 +12,7 @@ subclasses of `~fs.osfs.OSFS`.
 import typing
 
 import abc
-from appdirs import AppDirs
+from platformdirs import PlatformDirs
 
 from ._repr import make_repr
 from .osfs import OSFS
@@ -76,7 +76,7 @@ class _AppFS(OSFS,metaclass=_CopyInitMeta):
                 will be created if it does not exist.
 
         """
-        self.app_dirs = AppDirs(appname, author, version, roaming)
+        self.app_dirs = PlatformDirs(appname, author, version, roaming)
         self._create = create
         super(_AppFS, self).__init__(
             getattr(self.app_dirs, self.app_dir), create=create
diff --git a/setup.cfg b/setup.cfg
index b1db6b9..3cd1425 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -42,7 +42,7 @@ packages = find:
 setup_requires =
     setuptools >=38.3.0
 install_requires =
-    appdirs~=1.4.3
+    platformdirs >= 4
     setuptools
     enum34 ~=1.1.6      ;  python_version < '3.4'
     typing ~=3.6        ;  python_version < '3.6'
diff --git a/tests/test_appfs.py b/tests/test_appfs.py
index 2d42148..d9f2146 100644
--- a/tests/test_appfs.py
+++ b/tests/test_appfs.py
@@ -29,10 +29,9 @@ class _TestAppFS(fs.test.FSTestCases):
 
     def make_fs(self):
         with mock.patch(
-            "appdirs.{}".format(self.AppFS.app_dir),
-            autospec=True,
-            spec_set=True,
-            return_value=tempfile.mkdtemp(dir=self.tmpdir),
+            f"platformdirs.PlatformDirs.{self.AppFS.app_dir}",
+            new_callable=mock.PropertyMock,
+            return_value=tempfile.mkdtemp(),
         ):
             return self.AppFS("fstest", "willmcgugan", "1.0")
 
diff --git a/tests/test_opener.py b/tests/test_opener.py
index 43d5690..37c6f17 100644
--- a/tests/test_opener.py
+++ b/tests/test_opener.py
@@ -265,7 +265,7 @@ class TestOpeners(unittest.TestCase):
         mem_fs_2 = opener.open_fs(mem_fs)
         self.assertEqual(mem_fs, mem_fs_2)
 
-    @mock.patch("appdirs.{}".format(UserDataFS.app_dir), autospec=True, spec_set=True)
+    @mock.patch("platformdirs.{}".format(UserDataFS.app_dir), autospec=True, spec_set=True)
     def test_open_userdata(self, app_dir):
         app_dir.return_value = self.tmpdir
 
@@ -277,7 +277,7 @@ class TestOpeners(unittest.TestCase):
         self.assertEqual(app_fs.app_dirs.appauthor, "willmcgugan")
         self.assertEqual(app_fs.app_dirs.version, "1.0")
 
-    @mock.patch("appdirs.{}".format(UserDataFS.app_dir), autospec=True, spec_set=True)
+    @mock.patch("platformdirs.{}".format(UserDataFS.app_dir), autospec=True, spec_set=True)
     def test_open_userdata_no_version(self, app_dir):
         app_dir.return_value = self.tmpdir
 
@@ -286,7 +286,7 @@ class TestOpeners(unittest.TestCase):
         self.assertEqual(app_fs.app_dirs.appauthor, "willmcgugan")
         self.assertEqual(app_fs.app_dirs.version, None)
 
-    @mock.patch("appdirs.{}".format(UserDataFS.app_dir), autospec=True, spec_set=True)
+    @mock.patch("platformdirs.{}".format(UserDataFS.app_dir), autospec=True, spec_set=True)
     def test_user_data_opener(self, app_dir):
         app_dir.return_value = self.tmpdir