fix: replace deprecated vendored appdirs with platformdirs#447
Open
fuleinist wants to merge 1 commit into
Open
fix: replace deprecated vendored appdirs with platformdirs#447fuleinist wants to merge 1 commit into
fuleinist wants to merge 1 commit into
Conversation
The vendored appdirs module (ActiveState/appdirs) has been officially deprecated. This commit replaces it with the maintained platformdirs package (platformdirs/platformdirs), which is the recommended replacement. Changes: - Remove vendored pyinstrument/vendor/appdirs.py - Replace appdirs.user_data_dir() call with platformdirs.user_data_dir() - Add platformdirs to install_requires in setup.py Closes joerick#279
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The vendored
appdirsmodule (ActiveState/appdirs) has been officially deprecated. This PR replaces it with the maintainedplatformdirspackage (platformdirs/platformdirs), which is the recommended replacement per the appdirs project's own README.Changes
pyinstrument/vendor/appdirs.py(vendored copy, 605 lines)appdirs.user_data_dir()call withplatformdirs.user_data_dir()inpyinstrument/__main__.pyplatformdirstoinstall_requiresinsetup.pyVerification
platformdirs.user_data_dir("pyinstrument", "com.github.joerick")returns the correct path (~/.local/share/pyinstrumenton Linux,~/Library/Application Support/pyinstrumenton macOS,C:\Users\<user>\AppData\Local\com.github.joerick\pyinstrumenton Windows)report_dir()function works correctly end-to-endAPI compatibility
platformdirs.user_data_dir(appname, appauthor)matches theappdirs.user_data_dir(appname, appauthor)signature exactly, so this is a drop-in replacement with no behavioral change for end users.Fixes #279