-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
cli: update config file paths and plugin dirs on all OSes #3766
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
cli: update config file paths and plugin dirs on all OSes #3766
Conversation
5fccab6
to
d37e4e5
Compare
Changes look good, in regards to your questions:
|
d37e4e5
to
fb7814e
Compare
Summary
edit: deprecate in a separate PR after merging this one Officially deprecate
|
Not sure if the OSes should be properly split up in the docs. I've added macOS as another row to the three tables, but kept the "Unix-like (POSIX)" rows, which implies that macOS is included. This avoids having redundant paths, but also doesn't show that the regular POSIX paths are deprecated on macOS. So should the "Unix-like (POSIX)" rows be renamed to "Linux/BSD" and those paths added to the macOS rows (as deprecated)? |
I'd say this is a good plan. It clarifies things further and leads to less confusion which is always a plus. |
- use pathlib.Path instead of strings - rename PLUGINS_DIR to PLUGIN_DIRS and turn into list - call expanduser() for all `--plugin-dirs` dirs - reformat CLI docs - fix tests
Keep XDG_CONFIG_HOME for backwards compatibility
but keep "streamlinkrc" as secondary file for backwards compatiblity
Keep old paths for backwards compatiblity. Also fix logs dir (see --logfile). New default config path: ~/Library/Application Support/streamlink/config New default plugins dir: ~/Library/Application Support/streamlink/plugins
fb7814e
to
ce06efd
Compare
Updated the docs (with additional stylesheet updates) and properly split up the path definitions between macOS and Linux/BSD, which also means that the new |
Do we need deprecation log messages when loading stuff from those paths? |
@bastimeyer I feel like it's overkill but I've also learned people don't read the release notes and like to complain later. Will people read the CLI output noting as much? I'm not sure. If it's not too much work it's probably worth adding so we can point at release notes and CLI output when someone inevitably complains. |
ce06efd
to
63fe719
Compare
I've added the deprecation log messages. See my updated commit and its message.
|
If you want, we can deprecate these paths in another PR. That would probably be better for transparency reasons. |
63fe719
to
7ec8a89
Compare
@bastimeyer Should the deprecation message include information about where the new config directory is? Seems like just telling people the dir is deprecated without saying where to move things to might lead to some confusion.
Agreed. |
I'll add a docs-reference to the log messages in the deprecation PR once this one has been merged. As you can see, I removed the deprecation commit, so this PR here should be good unless someone spots a mistake. |
According to the XDG base directory specification, only configuration files are supposed to be in the
XDG_CONFIG_HOME
directory. This means that Streamlink's custom plugin files directory should default toXDG_DATA_HOME
and not toXDG_CONFIG_HOME
, as plugin files are not configuration files.XDG_DATA_HOME
to thePLUGIN_DIRS
on POSIX in addition toXDG_CONFIG_HOME
for backwards compatibility.This also raises the question whether we should add
%APPDATA%\streamlink\config
to theCONFIG_FILES
list on Windows, in addition to%APPDATA%\streamlink\streamlinkrc
. The current config file name comes from the time when Livestreamer was still using the~/.livestreamerrc
config file, which is deprecated anyway (not officially flagged as deprecated, but we could do that too). Yes, these are technically "run command files", hence the "rc" suffix, but the primary/intended config file name on non-Windows systems is already "config" and this helps solving confusion, especially for the average Windows user.Also not really sure about macOS. It has been treated as non-Windows the whole time (of course), but the XDG base dir spec doesn't really apply to it and they have other conventions (see the new log dir for example). This could also be corrected in another commit. Config path and plugin dir should be
${HOME}/Library/Application Support/streamlink/config
and${HOME}/Library/Application Support/streamlink/plugins
respectively if I'm not mistaken.Question 1:
Add
%APPDATA%\streamlink\config
in addition to%APPDATA%\streamlink\streamlinkrc
(and update config file path in the installer)?Question 2:
Use correct config and plugin paths on macOS?
Question 3:
Document
~/.streamlinkrc
as deprecated in the docs and remove it in the next major release3.0.0
?