Skip to content

Commit ad97338

Browse files
Migrate from appdirs to platformdirs (#4887)
* Migrate from appdirs to platformdirs Closes #4886
1 parent ba00fb2 commit ad97338

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

ChangeLog

+6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ What's New in Pylint 2.10.2?
1515
============================
1616
Release date: TBA
1717

18+
..
19+
Put bug fixes that should not wait for a new minor version here
20+
21+
* We now use platformdirs instead of appdirs since the latter is not maintained.
22+
23+
Closes #4886
1824

1925

2026
What's New in Pylint 2.10.1?

pylint/config/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
import sys
4141
from datetime import datetime
4242

43-
import appdirs
43+
import platformdirs
4444

4545
from pylint.config.configuration_mixin import ConfigurationMixIn
4646
from pylint.config.find_default_config_files import find_default_config_files
@@ -69,7 +69,7 @@
6969
elif USER_HOME == "~":
7070
PYLINT_HOME = ".pylint.d"
7171
else:
72-
PYLINT_HOME = appdirs.user_cache_dir("pylint")
72+
PYLINT_HOME = platformdirs.user_cache_dir("pylint")
7373
# The spam prevention is due to pylint being used in parallel by
7474
# pre-commit, and the message being spammy in this context
7575
# Also if you work with old version of pylint that recreate the

setup.cfg

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ project_urls =
4242
[options]
4343
packages = find:
4444
install_requires =
45-
appdirs>=1.4.0
45+
platformdirs>=2.0.0
4646
astroid>=2.7.2,<2.8 # (You should also upgrade requirements_test_min.txt)
4747
isort>=4.2.5,<6
4848
mccabe>=0.6,<0.7
@@ -75,15 +75,15 @@ markers =
7575
[isort]
7676
multi_line_output = 3
7777
line_length = 88
78-
known_third_party = appdirs, astroid, sphinx, isort, pytest, mccabe, six, toml
78+
known_third_party = platformdirs, astroid, sphinx, isort, pytest, mccabe, six, toml
7979
include_trailing_comma = True
8080
skip_glob = tests/functional/**,tests/input/**,tests/extensions/data/**,tests/regrtest_data/**,tests/data/**,astroid/**,venv/**
8181
src_paths = pylint
8282
8383
[mypy]
8484
scripts_are_modules = True
8585
86-
[mypy-appdirs]
86+
[mypy-platformdirs]
8787
ignore_missing_imports = True
8888
8989
[mypy-astroid.*]

tests/lint/unittest_lint.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
from os.path import abspath, basename, dirname, isdir, join, sep
5050
from shutil import rmtree
5151

52-
import appdirs
52+
import platformdirs
5353
import pytest
5454

5555
from pylint import checkers, config, exceptions, interfaces, lint, testutils
@@ -635,7 +635,7 @@ def test_pylint_home():
635635
if uhome == "~":
636636
expected = ".pylint.d"
637637
else:
638-
expected = appdirs.user_cache_dir("pylint")
638+
expected = platformdirs.user_cache_dir("pylint")
639639
assert config.PYLINT_HOME == expected
640640

641641
try:

0 commit comments

Comments
 (0)