Skip to content

Commit 0331e67

Browse files
authored
chore: Replace appdirspackage with platformdirs (#1373)
## Summary by Sourcery Replace usage of the deprecated appdirs package with platformdirs across configuration and runtime settings handling. Enhancements: - Update settings directory resolution to use platformdirs instead of appdirs. Build: - Replace appdirs dependency with platformdirs in project configuration and constraints as needed. Chores: - Tidy pyproject metadata formatting in the classifiers list. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Switched underlying platform directory provider used to determine the default settings/save folder; existing environment-variable override and versioned subfolder behavior remain unchanged. * Removed legacy pinned package and updated dependency metadata to reflect the new platform directory dependency across supported Python versions. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 661a0c1 commit 0331e67

13 files changed

Lines changed: 16 additions & 15 deletions

package/PartSeg/state_store.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import os
66
import sys
77

8-
import appdirs
98
import packaging.version
9+
import platformdirs
1010

1111
from PartSeg import APP_LAB, APP_NAME, __version__, parsed_version
1212

@@ -28,7 +28,7 @@
2828
save_suffix = ""
2929
#: path to folder where save settings
3030
save_folder = os.path.join(
31-
os.environ.get("PARTSEG_SETTINGS_DIR", appdirs.user_data_dir(APP_NAME, APP_LAB)),
31+
os.environ.get("PARTSEG_SETTINGS_DIR", platformdirs.user_data_dir(APP_NAME, APP_LAB)),
3232
str(packaging.version.parse(__version__).base_version),
3333
)
3434

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ classifiers = [
1717
"Development Status :: 3 - Alpha",
1818
"Framework :: napari",
1919
"Operating System :: OS Independent",
20-
"Programming Language :: Python :: 3",
20+
"Programming Language :: Python :: 3"
21+
,
2122
"Programming Language :: Python :: 3 :: Only",
2223
"Programming Language :: Python :: 3.9",
2324
"Programming Language :: Python :: 3.10",
@@ -45,7 +46,7 @@ dependencies = [
4546
"QtAwesome!=1.2.0,>=1.0.3",
4647
"QtPy>=1.10.0",
4748
"SimpleITK>=2.1.0",
48-
"appdirs>=1.4.4",
49+
"platformdirs>=4.3.0",
4950
"czifile>=2019.5.22",
5051
"defusedxml>=0.6.0",
5152
"fonticon-fontawesome6>=6.1.1",

requirements/constraints_py3.10.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ annotated-types==0.7.0
1010
# via pydantic
1111
app-model==0.4.0
1212
# via napari
13-
appdirs==1.4.4
13+
1414
# via
1515
# partseg (pyproject.toml)
1616
# napari

requirements/constraints_py3.10_pydantic_1.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ annotated-doc==0.0.4
88
# via typer
99
app-model==0.3.2
1010
# via napari
11-
appdirs==1.4.4
11+
1212
# via
1313
# partseg (pyproject.toml)
1414
# napari

requirements/constraints_py3.11.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ annotated-types==0.7.0
1010
# via pydantic
1111
app-model==0.4.0
1212
# via napari
13-
appdirs==1.4.4
13+
1414
# via
1515
# partseg (pyproject.toml)
1616
# napari

requirements/constraints_py3.11_pydantic_1.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ annotated-doc==0.0.4
88
# via typer
99
app-model==0.3.2
1010
# via napari
11-
appdirs==1.4.4
11+
1212
# via
1313
# partseg (pyproject.toml)
1414
# napari

requirements/constraints_py3.12.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ annotated-types==0.7.0
1010
# via pydantic
1111
app-model==0.4.0
1212
# via napari
13-
appdirs==1.4.4
13+
1414
# via
1515
# partseg (pyproject.toml)
1616
# napari

requirements/constraints_py3.12_docs.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ annotated-types==0.7.0
88
# via pydantic
99
app-model==0.4.0
1010
# via napari
11-
appdirs==1.4.4
11+
1212
# via
1313
# partseg (pyproject.toml)
1414
# napari

requirements/constraints_py3.12_pydantic_1.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ annotated-doc==0.0.4
88
# via typer
99
app-model==0.3.2
1010
# via napari
11-
appdirs==1.4.4
11+
1212
# via
1313
# partseg (pyproject.toml)
1414
# napari

requirements/constraints_py3.13.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ annotated-types==0.7.0
1010
# via pydantic
1111
app-model==0.4.0
1212
# via napari
13-
appdirs==1.4.4
13+
1414
# via
1515
# partseg (pyproject.toml)
1616
# napari

0 commit comments

Comments
 (0)