add basic XDG_CONFIG_HOME support #278

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
2 participants
Owner

minrk commented Feb 21, 2011

This commit adds basic support for XDG_CONFIG_HOME (default ~/.config), and tests to verify behavior.

  • For users who already have ~/.ipython, this will have no effect until they manually create ~/.config/ipython (or wherever their $XDG_CONFIG_HOME points).
  • new users will use ~/.config/ipython if ~/.config exists, else ~/.ipython
  • If both exist, ~/.config/ipython has priority over ~/.ipython

I could change it so that, if we want to keep using ~/.ipython as the default, XDG_CONFIG_HOME is only used if it is explicitly specified, rather than defaulting to ~/.config.

This might close #48 and its duplicate, #246. The reason it might not is that XDG recommends use of different directories for cache, runtime, and data, which would split the ipython dir. I'm not sure that regular terminal IPython would have much use for these, but the parallel computing code does have PID files, etc. that could logically fall into other categories.

use XDG_CONFIG_HOME if available
priority is:

$XDG/ipython if both or neither exist
$HOME/.ipython if it exists and $XDG/ipython does not exist

closes gh-48
closes gh-246
Owner

fperez commented Feb 22, 2011

I'm inclined to switch to ~/.config/ipython for all new users. Might as well start following standards :)

But before we merge, the policy should be documented: the docs describe ~/.ipython in a lot of places, so the new policy should be explained.

And for now, I'd stick to just one dir, ignoring the XDG guidelines for multiple dirs. Let's get the basic part working first, but with our design of one ipython dir and subdirectories below it. If we read the full basedir spec (http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html) and were to follow it all, we might need to have logic for DATA_DIRS, CACHE_HOME and RUNTIME_DIR. That's more complexity than I want to mess with now, especially since we haven't even finalized how much we want to serialize and where we want it. Those decisions are easier to make if we just have one location to think about instead of 4 different things.

Owner

minrk commented Feb 22, 2011

Okay, I can scan for .ipython references in the docs. Do you have a sense of exactly what you think that should look like? It's now a little harder, since I can't just replace .ipython with .config/ipython, since that will only be true for systems that use .config.

Speaking of following standards, do we also want to comply with OSX standards, and use ~/Library there?

Owner

fperez commented Feb 22, 2011

I think for now, we can use ```ipython_dir` in references, explaining once the logic that sets it.

I'm not sure about osx: do people prefer to use ~/Library/foo vs ~/.foo for more unix-type projects? I'll defer to you on how you prefer to go about it, since you have a much better feel for the platform than I do.

Owner

minrk commented Feb 22, 2011

Okay, I'll start some finding and replacing.

command-line unix programs tend to not pay attention to OSX config standards, but real applications do (unless they are bad platform citizens). With things like the qtconsole, IPython is starting to straddle the gap. I would say leave .ipython on OSX for now, but add Library support if/when we do implement the split XDG basedir spec.

Owner

fperez commented Feb 22, 2011

Sounds good. I was thinking exactly what you said, that with the new tools we're becoming much more of a real set of apps than just an 80's style unix tool...

Owner

minrk commented Feb 23, 2011

I've scanned through the code and docs for ~/.ipython and made adjustments, and adding a short explanation into usage and the config overview.

Owner

fperez commented Feb 23, 2011

Looks great, merge away. Thanks!

Owner

minrk commented Feb 23, 2011

Merge 'XDG', introducing basic XDG_CONFIG_HOME support

closed by 15ce9bf
closed by 15ce9bf
closed by 15ce9bf

markvoorhies pushed a commit to markvoorhies/ipython that referenced this pull request Apr 21, 2011

mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment