<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div><div>Hi all,<br><br></div>Just want to point out that if tools can accept a config file in<br></div>a cross-platform standard location <br>(perhaps in addition to a platform-specific one), <br>then that is incredibly useful.<br></div><br></div>Just search on Github for "dotfiles", and see how many people<br></div>store their configuration in a git repo, so they can just go to<br></div>a fresh machine, "git clone dotfiles" in their $HOME and be fully set up.<br><br></div><div>A platform-independent location also simplifies life for us who<br></div><div>use Linux, Windows and MacOs on a daily basis.<br></div><div>(And then there is the fact that these platform "standards" are<br></div><div>only followed very haphazardly anyway, e.g. <br>Windows Vim uses ~\.vimrc on Windows and not somewhere in $LOCALAPPDATA .)<br></div><div><br></div>As an aside, I don't agree with the "appdirs" package on Linux:<br></div>XDG != Linux. That may seem pedantry, but while ~/.local is perhaps<br></div>not too bad for user-specific config, /etc/xdg is almost certainly the <br></div>wrong location for global config any application that is not part of<br></div>a desktop environment. <br>(In fact, such a directory may not exist on a typical headless Linux install.)<br></div><br></div>Stephan<br><div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-02-06 16:44 GMT+01:00 Paul Moore <span dir="ltr"><<a href="mailto:p.f.moore@gmail.com" target="_blank">p.f.moore@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 6 February 2018 at 15:23, Eric Fahlgren <<a href="mailto:ericfahlgren@gmail.com">ericfahlgren@gmail.com</a>> wrote:<br>
> Right, different planets, but orbiting the same star. I was thinking about<br>
> the consolidation of the Windows registry layout a year or two ago, don't<br>
> recall who spearheaded that (Steve Dower?). In any case, if the various<br>
> tools either followed that convention, or we came up with an ini-based one<br>
> that was consistent with it and usable on Unix (.pyconf or something)...<br>
<br>
</span>Yep, that would be an informational PEP, defining standards we expect<br>
Python applications to follow. There's a lot more Python<br>
*applications* than there are Python *distributions*, and I'm not<br>
convinced a standard for applications would get much traction (even<br>
ignoring the need they'd have for backward compatibility) but if<br>
someone wants to try to get consensus on something, then have fun!<br>
<br>
Actually, the `appdirs` project (<a href="https://pypi.python.org/pypi/appdirs" rel="noreferrer" target="_blank">https://pypi.python.org/pypi/<wbr>appdirs</a>)<br>
does exactly this - provides a portable interface for applications to<br>
store config data in platform-specific locations. The correct answer<br>
is probably to persuade application developers to use appdirs rather<br>
than their own schemes.<br>
<br>
Pip and py both use appdirs-compatible schemes (py doesn't use appdirs<br>
itself, as it's not written in Python, but pip does).<br>
<br>
pip: appdirs.user_config_dir('pip', appauthor=False, roaming=True)<br>
py: appdirs.user_config_dir()<br>
<br>
You could argue that appdirs offers too many options - but if all<br>
applications used appdirs, you could have that debate once with the<br>
appdirs authors, rather than having to persuade every application in<br>
turn.<br>
<span class=""><br>
> Yeah, our Windows dev environment uses Cygwin, so I'm constantly confused.<br>
> :)<br>
<br>
</span>Yuk, Cygwin. I'll refrain from commenting further :-)<br>
<span class=""><br>
> Not sure how to make pip cough up similar verbose output, but when it<br>
> started complaining about legacy formats, I just followed its directions and<br>
> this works:<br>
><br>
>> ll $USERPROFILE/pip/pip.ini<br>
> -rw-r--r-- efahlgren 2017-04-30 15:51 'C:/Users/efahlgren/pip/pip.<wbr>ini'<br>
<br>
</span>Backward compatibility. When we moved to the Windows-standard<br>
location, we left in fallbacks to the old locations. I've no idea<br>
whether pip sees Cygwin as Windows-like or Unix-like, so anything<br>
could be going on beyond that.<br>
<span class="HOEnZb"><font color="#888888"><br>
Paul<br>
</font></span><div class="HOEnZb"><div class="h5">______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/<wbr>codeofconduct/</a><br>
</div></div></blockquote></div><br></div>