Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a few default locations for the Palladium config file #103

Merged
merged 1 commit into from
May 23, 2019

Conversation

dnouri
Copy link
Collaborator

@dnouri dnouri commented Apr 25, 2019

If PALLADIUM_CONFIG is not set, Palladium will try to find a
configuration file at these locations:

  • palladium-config.py
  • etc/palladium-config.py
  • /etc/palladium-config.py

I used print() rather than logging when a default config location is used because logging isn't set up at that point yet.

@coveralls
Copy link

coveralls commented Apr 25, 2019

Coverage Status

Coverage increased (+0.0002%) to 99.927% when pulling 74da978 on feature/default-configfile-name into 60db450 on develop.

@BenjaminBossan
Copy link

This will not be helpful on Windows ;)

@dnouri
Copy link
Collaborator Author

dnouri commented Apr 26, 2019

This will not be helpful on Windows ;)

Do you have an idea on what locations would be useful to look for on Windows? Maybe C:\Benjamin\Palladium.CFG? :-)

@dnouri dnouri force-pushed the feature/default-configfile-name branch from 94daebe to 1878179 Compare April 26, 2019 12:09
@BenjaminBossan
Copy link

I know that there was a Python package that provides all the default directories for the common OSes but I cannot find it unfortunately.

@topiaruss
Copy link

topiaruss commented Apr 26, 2019 via email

@BenjaminBossan
Copy link

Yes, that's the one.

@dnouri
Copy link
Collaborator Author

dnouri commented May 4, 2019

Thanks for the pointer. It's true that I've included one global path (/etc/palladium-config.py) in the list of default locations, with the two other locations being relative to the current working directory. The intention here was to include the global path as a convenience for Docker containers. I don't think global directories make sense apart from that use case. Palladium projects will typically include the configuration relative to the project root within the source tree. After all, you'll want to be able to develop multiple Palladium projects at the same time. And I'm now thinking that the one global path may not be useful after all. (What do you think?) At the same time, I don't believe we want to put configuration in app directories, such as the ones made available by the appdirs package, because that's not how you use Palladium on your development machine.

Another question I have is: Do we want the tutorial to make use of the default palladium-config.py in the current working directory?

@BenjaminBossan
Copy link

For the docker use case, is it too much to ask from the user to specify PALLADIUM_CONFIG?

Regarding the tutorial, it should teach the "proper" way of doing things.

Also, at least in my use cases, I now always have multiple config files, so having that default would not be helpful.

@dnouri dnouri force-pushed the feature/default-configfile-name branch from 1878179 to 644ed35 Compare May 13, 2019 11:15
@dnouri
Copy link
Collaborator Author

dnouri commented May 13, 2019

Thanks for the feedback. I've removed the /etc/palladium-config.py entry.

@dnouri dnouri changed the base branch from master to develop May 23, 2019 11:08
If ``PALLADIUM_CONFIG`` is not set, Palladium will try to find a
configuration file at these locations:

- ``palladium-config.py``
- ``etc/palladium-config.py``
@dnouri dnouri force-pushed the feature/default-configfile-name branch from 644ed35 to 74da978 Compare May 23, 2019 14:23
@alattner alattner merged commit 5913e59 into develop May 23, 2019
@alattner alattner deleted the feature/default-configfile-name branch August 15, 2019 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants