Migrating from appdirs to platformdirs (Closes: #1067983).
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
a82b9b2354
commit
038d50b0a2
2 changed files with 54 additions and 0 deletions
53
debian/patches/debian/0001-platformdirs.patch
vendored
Normal file
53
debian/patches/debian/0001-platformdirs.patch
vendored
Normal file
|
@ -0,0 +1,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.
|
1
debian/patches/series
vendored
Normal file
1
debian/patches/series
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
debian/0001-platformdirs.patch
|
Loading…
Add table
Reference in a new issue