Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from appdirs to platformdirs #4887

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ What's New in Pylint 2.10.2?
============================
Release date: TBA

..
Put bug fixes that should not wait for a new minor version here

* We now use platformdirs instead of appdirs since the latter is not maintained.

Closes #4886


What's New in Pylint 2.10.1?
Expand Down
4 changes: 2 additions & 2 deletions pylint/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import sys
from datetime import datetime

import appdirs
import platformdirs

from pylint.config.configuration_mixin import ConfigurationMixIn
from pylint.config.find_default_config_files import find_default_config_files
Expand Down Expand Up @@ -69,7 +69,7 @@
elif USER_HOME == "~":
PYLINT_HOME = ".pylint.d"
else:
PYLINT_HOME = appdirs.user_cache_dir("pylint")
PYLINT_HOME = platformdirs.user_cache_dir("pylint")
# The spam prevention is due to pylint being used in parallel by
# pre-commit, and the message being spammy in this context
# Also if you work with old version of pylint that recreate the
Expand Down
6 changes: 3 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ project_urls =
[options]
packages = find:
install_requires =
appdirs>=1.4.0
platformdirs>=2.0.0
astroid>=2.7.2,<2.8 # (You should also upgrade requirements_test_min.txt)
isort>=4.2.5,<6
mccabe>=0.6,<0.7
Expand Down Expand Up @@ -75,15 +75,15 @@ markers =
[isort]
multi_line_output = 3
line_length = 88
known_third_party = appdirs, astroid, sphinx, isort, pytest, mccabe, six, toml
known_third_party = platformdirs, astroid, sphinx, isort, pytest, mccabe, six, toml
include_trailing_comma = True
skip_glob = tests/functional/**,tests/input/**,tests/extensions/data/**,tests/regrtest_data/**,tests/data/**,astroid/**,venv/**
src_paths = pylint

[mypy]
scripts_are_modules = True

[mypy-appdirs]
[mypy-platformdirs]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Pierre-Sassoulas FYI, you should be able to remove this, since another benefit of platformdirs is it is fully statically typed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CAM-Gerlach Thanks for the heads up! We can indeed remove it (#4889), although we need to bump the required version first (#4890).

ignore_missing_imports = True

[mypy-astroid.*]
Expand Down
4 changes: 2 additions & 2 deletions tests/lint/unittest_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
from os.path import abspath, basename, dirname, isdir, join, sep
from shutil import rmtree

import appdirs
import platformdirs
import pytest

from pylint import checkers, config, exceptions, interfaces, lint, testutils
Expand Down Expand Up @@ -635,7 +635,7 @@ def test_pylint_home():
if uhome == "~":
expected = ".pylint.d"
else:
expected = appdirs.user_cache_dir("pylint")
expected = platformdirs.user_cache_dir("pylint")
assert config.PYLINT_HOME == expected

try:
Expand Down