-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Use a subdirectory of $XDG_CONFIG_HOME instead of ~/.matplotlibrc on Linux #454
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
Conversation
FWIW, here's what we've done on this topic: http://ipython.org/ipython-doc/dev/config/overview.html#configuration-file-location It is indeed a little more information to provide, since osx is now different than linux, but people felt that following the xdg standard was a good idea. |
On Mac OS X, this kind of files tend to go in ~/Library/Application Support. I think that directory is strictly meant for applications, not libraries, so e.g. a hypothetical application named Pylab.app might place its files in ~/Library/Application Support/org.scipy.Pylab. Even more strictly, application configuration should go in ~/Library/Preferences and be managed with the appropriate OS X APIs. A lot of common Unix programs do keep their configuration in dotfiles in the home directory, though. |
Could we have it so that if that environment variable is set, then use it. Otherwise, stick with the old location for now? However, there might be some issues if a person already has an rc file in both locations, how do we know which one to use? |
Sounds like a good idea. Shall we get on and implement it? Anyone keen to give it a shot? |
What is planned now about FreeDesktop.org XDG basedir specification for matplotlib? http://ploum.net/post/207-modify-your-application-to-use-xdg-folders |
+1 on doing this. This has obviously just fallen through the cracks. I think we should plan this for the next major release (I've added a milestone). |
According to XDG Base directory specification: Full specification can be found at: The Freedesktop.org XDG base directory specification have good de facto adoption.
I think that matplotlib should use same locations than the vast majority of Desktop environment and applications. There are real advantages of following this specification :
|
@eheintzmann, @fperez: Anyone willing to test this, to make sure the migration path works? I'd like to get this in for 1.3. If a @WeatherGod: I deliberately didn't change behavior on OS-X. We could consider |
…and cache directories
@mdboom - the warning was good. But I wonder if we can do this migration automatically? Especially given that the only files in my |
Most of the files in With this PR, all of the cache files will automatically (and silently) start being created and used in |
That was not my experience (I didn't look at the code, just ran it...). I'm happy with the approach you discuss though. |
|
||
p = os.path.join(h, '.matplotlib') | ||
if os.path.exists(p): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the bit which causes the warning for people with a cache but not necessarily a matplotlibrc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see. I'll fix that up.
Use a subdirectory of $XDG_CONFIG_HOME instead of ~/.matplotlibrc on Linux
Use a subdirectory of $XDG_CONFIG_HOME instead of ~/.matplotlibrc on Linux
See pull request matplotlib#454 (3ac8144)
The latest version of the XDG basedir spec seems to recommend this.
http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
Is this something we want to do? Will it only add to confusion for platforms that don't use this (presumably Mac OS-X)?