summaryrefslogtreecommitdiffstats
path: root/debian/patches/debian/0001-platformdirs.patch
blob: 06186e74cb384079ec584b5ac2bfcba02c897c2b (plain)
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
Author: Daniel Baumann <daniel.baumann@progress-linux.org>
Description: Migrating from appdirs to platformdirs (Closes: #1067983).

diff -Naurp ptpython.orig/README.rst ptpython/README.rst
--- ptpython.orig/README.rst
+++ ptpython/README.rst
@@ -201,8 +201,8 @@ Configuration
 *************
 
 It is possible to create a ``config.py`` file to customize configuration.
-ptpython will look in an appropriate platform-specific directory via `appdirs
-<https://pypi.org/project/appdirs/>`. See the ``appdirs`` documentation for the
+ptpython will look in an appropriate platform-specific directory via `platformdirs
+<https://pypi.org/project/platformdirs/>`. See the ``platformdirs`` documentation for the
 precise location for your platform. A ``PTPYTHON_CONFIG_HOME`` environment
 variable, if set, can also be used to explicitly override where configuration
 is looked for.
diff -Naurp ptpython.orig/ptpython/entry_points/run_ptpython.py ptpython/ptpython/entry_points/run_ptpython.py
--- ptpython.orig/ptpython/entry_points/run_ptpython.py
+++ ptpython/ptpython/entry_points/run_ptpython.py
@@ -32,7 +32,7 @@ import sys
 from textwrap import dedent
 from typing import IO
 
-import appdirs
+import platformdirs
 from prompt_toolkit.formatted_text import HTML
 from prompt_toolkit.shortcuts import print_formatted_text
 
@@ -106,9 +106,9 @@ def get_config_and_history_file(namespac
     """
     config_dir = os.environ.get(
         "PTPYTHON_CONFIG_HOME",
-        appdirs.user_config_dir("ptpython", "prompt_toolkit"),
+        platformdirs.user_config_dir("ptpython", "prompt_toolkit"),
     )
-    data_dir = appdirs.user_data_dir("ptpython", "prompt_toolkit")
+    data_dir = platformdirs.user_data_dir("ptpython", "prompt_toolkit")
 
     # Create directories.
     for d in (config_dir, data_dir):
diff -Naurp ptpython.orig/setup.py ptpython/setup.py
--- ptpython.orig/setup.py
+++ ptpython/setup.py
@@ -18,7 +18,7 @@ setup(
     packages=find_packages("."),
     package_data={"ptpython": ["py.typed"]},
     install_requires=[
-        "appdirs",
+        "platformdirs",
         "importlib_metadata;python_version<'3.8'",
         "jedi>=0.16.0",
         # Use prompt_toolkit 3.0.34, because of `OneStyleAndTextTuple` import.