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

improve settings priority, #343

Merged
merged 4 commits into from Dec 29, 2018

Conversation

Projects
None yet
2 participants
@samuelcolvin
Copy link
Owner

samuelcolvin commented Dec 28, 2018

Change Summary

Improve documentation for settings priority and allow them to be more easily changed.

Related issue number

ref #341

Checklist

  • Unit tests for the changes exist
  • Tests pass on CI and coverage remains at 100%
  • Documentation reflects the changes
  • No performance deterioration (if applicable)
  • HISTORY.rst has been updated
    • if this is the first change since a release, please add a new section
    • include the issue number or this pull request number #<number>
    • if you're not a regular contributer please include your github username @whatever

@samuelcolvin samuelcolvin force-pushed the settings-priority branch from 514a517 to 501d4fe Dec 28, 2018

@codecov

This comment has been minimized.

Copy link

codecov bot commented Dec 28, 2018

Codecov Report

Merging #343 into master will not change coverage.
The diff coverage is 100%.

@@          Coverage Diff          @@
##           master   #343   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          14     14           
  Lines        1820   1818    -2     
  Branches      356    356           
=====================================
- Hits         1820   1818    -2
s = Settings(__config_settings__=config, b='argument b', c='argument c')
assert s.a == 'config a'
assert s.b == 'argument b'
assert s.c == 'env setting c'

This comment has been minimized.

@dbarrosop

dbarrosop Dec 29, 2018

Not sure if I am misreading something but according to the docs the order of preference is class_defaults < env < arguments, however, your test is proving that class_defaults < arguments < env. I might be misreading this completely but my tests seem to confirm this.

This comment has been minimized.

@dbarrosop

dbarrosop Dec 29, 2018

Ok, just realized that your test case is testing changing the order + using the __config_settings__ trick, not the default case. So all is good and I managed to get it working exactly as I wanted, thanks a lot!

@samuelcolvin samuelcolvin force-pushed the settings-priority branch from 0b4f10f to 3c05c04 Dec 29, 2018

@samuelcolvin samuelcolvin merged commit 19320bf into master Dec 29, 2018

5 checks passed

codecov/project 100% (+0%) compared to 0f7f8fc
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
deploy/netlify Deploy preview ready!
Details
pyup.io/safety-ci No dependencies with known security vulnerabilities.
Details

@samuelcolvin samuelcolvin deleted the settings-priority branch Dec 29, 2018

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