Skip to content

Consider using appdirs for config聽#8245

Closed

Description

@Cadair

Rather than re-implementing all the logic of finding the platform specific location for config files, we should just use https://github.com/ActiveState/appdirs 馃榾

@eteq

Activity

  1. bsipocz commented on Dec 11, 2018

    @bsipocz
    Member

    Which raises the question whether it's worth to the addition of another non optional dependency.

    Pinging @taldcroft and @mhvk. If they are OK with the idea, I'm too.

  2. astrofrog commented on Dec 11, 2018

    @astrofrog
    Member

    Just our of curiosity, how much code would this save?

  3. Cadair commented on Dec 11, 2018

    @Cadair
    MemberAuthor

    Pretty much everything in confg/paths.py. It would also use more "standard" semantics, and move the responsibility of being standards compliant to other people.

    it's also worth noting that appdirs is a single file, so can easily be copied into tree. I took a quick swing at this here: Cadair@ae1aa4a

  4. pllim commented on Dec 11, 2018

    @pllim
    Member

    20 additions and 145 deletions -- me likey!

  5. mhvk commented on Dec 11, 2018

    @mhvk
    Contributor

    I like the idea, though obviously it means that everyone's config/cache are going to move from .astropy to new locations. A bit of a pain, even if the new locations are more logical.

    Note that it does seem one could make similar gains in size by replacing _find_home with pathlib.Path.home(), but that of course doesn't give the benefit of pushing responsibility for ensuring that this remains up to date to others, nor that configuration directories will be more standard.

    Aside: appdirs.py is not very large, at 617 lines.

  6. astrofrog commented on Dec 11, 2018

    @astrofrog
    Member

    I'd be in favor (including bundling it in astropy/extern for now)

    It would be nice to find a way to warn users who do have config directories about the change.

  7. pllim commented on Dec 11, 2018

    @pllim
    Member

    4.0 would be a good time to do this if you want to move the locations.

  8. bsipocz commented on Dec 11, 2018

    @bsipocz
    Member

    I'm on board, given that we bundle it. Also, agree with @pllim that if the config dir changes, it's better do in 4.0.

  9. Cadair commented on Apr 15, 2019

    @Cadair
    MemberAuthor

    It would be nice to find a way to warn users who do have config directories about the change.

    Is it worth doing this in the 3.2 release? Or shall we just do it in 4.0 and emit a warning as and when we migrate locations?

    (not really sure I know what we would do in 3.2, but I just want to check)

  10. pllim commented on Oct 30, 2019

    @pllim
    Member

    With #8237 in, is this resolved?

  11. astrofrog commented on Oct 30, 2019

    @astrofrog
    Member

    @pllim - no, #8237 doesn't change anything in terms of where, system-wide, the config/cache directories end up.

  12. pllim commented on Mar 30, 2020

    @pllim
    Member

    Note to self: Does not quite solve the problem of disabling config altogether (#5899, #7290).

  13. embray commented on Sep 16, 2020

    @embray
    Member

    I was excited about this idea at first--it would be great to have a "standard" library for this sort of thing. But upon closer inspection, I think the layout used by appdirs is better suited for things like desktop applications, where (non-developer) users are less likely to be poking around directly in their config directories.

    In fact, I think this would be a user-hostile change. In particular for MacOS users, and to some extent Windows users as well.

    For example, MacOS users are already accustomed to, by default, finding all Astropy-related stuff in ~/.astropy which is pretty clear, easy to document, and easy to remember. Using appdir would put the astropy config dir in: ~/Library/Preferences/astropy. Opaque, confusing. Especially when on Linux it would be in ~/.config/astropy--when switching between systems, or SSHing from a Mac to a Linux system this would be jarring. Even worse if mounting a shared home directory.

    Having ~/.astropy/config be the default config directory (while maintaining support for XDG_CONFIG_HOME where explicitly set) is the most user-friendly option. However, I think there are some things we can do to better support users, so see #10738

  14. astropy-bot commented on Sep 24, 2020

    @astropy-bot

    Hi humans 馃憢 - this issue was labeled as Close? approximately 7 days ago. If you think this issue should not be closed, a maintainer should remove the Close? label - otherwise, I will close this issue in a month.

    If you believe I commented on this issue incorrectly, please report this here

  15. astrojuanlu commented on Dec 28, 2020

    @astrojuanlu
    Member

    The bot forgot to close this issue so... I'll proceed.

  16. pllim commented on Dec 28, 2020

    @pllim
    Member

    @astrofrog (a.k.a. "Helen") should look into the cron job for the bot. Maybe it's not working...

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions