Config framework #698
Replies: 4 comments
-
Rolling our own environment variable code seems easier to me than the cross-platform path search. Maybe we can still do this even if we use a package that doesn't implement env variable stuff. |
Beta Was this translation helpful? Give feedback.
-
Hey Chris, thanks for putting this info together and asking our RSE friend. I took a look at From our chat today, I think we confirmed we are just looking to config numerical backends and logging. Everything else should probably be in our code/classes. The logging potentially has a fair amount of config. |
Beta Was this translation helpful? Give feedback.
-
Matplotlib approach: https://matplotlib.org/stable/tutorials/introductory/customizing.html |
Beta Was this translation helpful? Give feedback.
-
Leaning towards |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Some things we want to be able to do with a config system after talking with @garrettwrong:
1 - Automatically detect config file in package directory. In particular, we want automatic path searching. For instance, first look for a
config.ini
in the working directory, then in the home directory, finally defaulting to a config file shipped with the package.2 - A simple file format. We currently use
.ini
along with the standard library'sconfigparser
. Other options are YAML, TOML, or even.py
3 - We may want an environment variable set to path to config file?
4- We want to be able to ship a GPU config file ready to go
Some notes on the options out there:
configparser
: From what I can tell, this does not implement 1) above. It could be quite involved to write a cross-platform path searchconfuse
: This is for YAML. We have heard good things from RC's Python expertdynaconf
: This is popular on Reddit and StackOverflow threads, but looks like it's probably overkill. Also seems to have partly dropped 3.7 supportconfig-path
This might do what we want as far as cross-platform path search. It hasn't been updated in a while but looks official and is marked as "production/stable" on PyPI.configparser
+config-path
+ INI's is jumping out at me as the simplest solution to look into first.Beta Was this translation helpful? Give feedback.
All reactions