Updates toml library
Depends on:
- https://github.com/bw2/ConfigArgParse/pull/316
- https://github.com/bw2/ConfigArgParse/pull/324
- Updates toml lib
- Uses the latest and greatest first, and fallbacks to
tomliif its not there
- Uses the latest and greatest first, and fallbacks to
- Increases baseline test coverage by 6%
Also, please. I need this for another project, can this be released as soon as possible? 1.7.2 or 1.8.0?
Looks fine to me. @tristanlatr @tbooth @agyoungs any objections to this and doing another release?
Looks fine to me. @tristanlatr @tbooth @agyoungs any objections to this and doing another release?
Thanks for the ping. I'll have time in a day or two to look at this unless someone beats me to it
The switch to the new tomllib with a fallback to tomli makes sense.
However, I'll note that this PR introduces a dependency on the pytest module, which was not necessary to run the test suite in the past. Also the new tests are written in the pytest style, using @pytest.fixture decorators and bare assert statements rather than self.assertEqual() and friends. This is at odds with all the existing tests.
Personally I find the pytest approach hard to read and at odds with the "explicit is better than implicit" maxim of Python.
I think if there is a decision to move to this style of tests it should be all or nothing, and not just introduced on-the-fly within this PR. Or else, these new tests could very easily be written without the need for pytest.
Speaking as a pytest dev member -- well you know my bias.. I'm very pro-pytest.
@kingbuzzman I appreciate @tbooth 's point, and looking at this again, I agree that we should avoid heterogeneous testing styles where possible. Would you be up for switching this to the same style as existing tests?
I'm looking to put my money where my mouth is and re-write the tests without using pytest myself. It's a useful exercise as in the process I'm uncovering some issues. Specifically, if I comment out line 1844 in tests/test_configargparse.py (ie. the line that adds configargparse.TomlConfigParser(['section']), to the composite parser) then all the tests still pass.
That can't be right!
Also, if I switch back to using the old import toml and run these new tests then all the tests still pass (if I change 'rb' to 'r' when opening the toml files in the tests), so what are we actually gaining from this change? I think we need a test or two to demonstrate why the old code is inadequate, not just to show that the new change doesn't break anything.