pcdshub / happi

Heuristic Access to Positions of Photon Instruments
https://pcdshub.github.io/happi/master
Other
13 stars 29 forks source link

ENH: fall back to platformdirs user_config_dir #312

Closed untzag closed 1 year ago

untzag commented 1 year ago

Description

Add platformdirs dependency. platformdirs itself has no dependencies as far as I know, so don't worry about dependency chains.

Fall back to platformdirs.user_config_dir if happi cfg not found in XDG_CONFIG_HOME or .config.

Motivation and Context

Gives an additional sane default. Especially useful on workstations running Windows or MacOS. Especially machines that I don't control...

How Has This Been Tested?

It just looks in one additional place, I don't think we need tests... happy to add if maintainers request.

Where Has This Been Documented?

Pre-merge checklist

untzag commented 1 year ago

If someone has a clue about the 3.11 failures I'd appreciate any insight.

klauer commented 1 year ago

If someone has a clue about the 3.11 failures I'd appreciate any insight.

Don't worry about it - it's not required for merging. We noticed the failures when migrating to pyproject.toml (https://github.com/pcdshub/happi/pull/296) due to a dependency, line-profiler, and its incompatibilities with our Python version matrix. More details are in that PR, if you want to know more.

ZLLentz commented 1 year ago

I think this is :+1: I'm also surprised that appdirs is deprecated- it looks like it wasn't abandoned for a technical reason, but instead due to not having time to maintain it any more. This is speculation of course, but I think it's true considering the text in the readme:

Note: This project has been officially deprecated. You may want to check out https://pypi.org/project/platformdirs/ which is a more active fork of appdirs. Thanks to everyone who has used appdirs. Shout out to ActiveState for the time they gave their employees to work on this over the years.

Implying that it started at a company named ActiveState who eventually said "stop spending time on this"