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 support for configuration inside 'setup.cfg' #161

Merged
merged 4 commits into from
Jun 22, 2017
Merged

Add support for configuration inside 'setup.cfg' #161

merged 4 commits into from
Jun 22, 2017

Conversation

althonos
Copy link
Contributor

While I am at it, I added support for green configuration inside setup.cfg, since there seem to be an almost official agreement about using this file for Python dev tools configuration.

setup.cfg is the only file where the [green] section is expected.

@coveralls
Copy link

coveralls commented Jun 21, 2017

Coverage Status

Coverage remained the same at 100.0% when pulling 70488cc on althonos:feat-setupcfg into 8a7a0bd on CleanCut:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 70488cc on althonos:feat-setupcfg into 8a7a0bd on CleanCut:master.

Copy link
Owner

@CleanCut CleanCut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great start!

To change:

  • setup.cfg should come first in the list, because we traverse the config file list in order and each later file overrides earlier files, which unintuitively means that the later an item is in the list, the more important it is. setup.cfg should be lower priority, so it should come earlier in the list.

To add:

  • The documentation for config files needs to be updated in green/config.py. setup.cfg should be the new item 3, with existing items 3-5 becoming 4-6.
  • Tests! Where are the tests?! ;-)

@CleanCut
Copy link
Owner

Also...I wonder if we should change our config-file resolution behavior from merge-all to "first config wins..." Something to ponder.

@CleanCut
Copy link
Owner

I've been pondering it. I like the current merging-of-configs behavior, I think.

By the way, if you feel like you need some help with my review suggestions, let me know and (I think) I can make a PR to your PR adding some of the stuff. If that helps.

@althonos
Copy link
Contributor Author

althonos commented Jun 22, 2017

Merging is okay, this allows changing some things locally while having a global configuration that is used everywhere, both of which can be updated independantly.

I do not agree with setup.cfg being the least in priority however, since it is a local configuration file (at the root of a Python project): it should have precedence over the global settings, as the .green file does.

EDIT: Oh, I see what you mean, not absolute first but just come before .green.

@coveralls
Copy link

coveralls commented Jun 22, 2017

Coverage Status

Coverage remained the same at 100.0% when pulling 2379baa on althonos:feat-setupcfg into 8a7a0bd on CleanCut:master.

@CleanCut
Copy link
Owner

Yes, I meant switch it with .green. Sorry, I could have explained that more clearly.

Copy link
Owner

@CleanCut CleanCut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@CleanCut CleanCut merged commit 7faa890 into CleanCut:master Jun 22, 2017
@althonos althonos deleted the feat-setupcfg branch June 22, 2017 16:06
@CleanCut
Copy link
Owner

Included in just-released version 2.9.0.

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.

3 participants