omni-us / jsonargparse

Implement minimal boilerplate CLIs derived from type hints and parse from command line, config files and environment variables
https://jsonargparse.readthedocs.io
MIT License
314 stars 42 forks source link

Account for breaking change in argparse.ArgumentParser._parse_optional affecting python 3.11.9 and likely >=3.13 #486

Closed mauvilsa closed 4 months ago

mauvilsa commented 5 months ago

What does this PR do?

Fixes #484

Before submitting

sonarcloud[bot] commented 5 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

codecov[bot] commented 5 months ago

Codecov Report

Attention: Patch coverage is 90.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 99.98%. Comparing base (c9732a5) to head (a7cb5e4).

Files Patch % Lines
jsonargparse/_typehints.py 80.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #486 +/- ## =========================================== - Coverage 100.00% 99.98% -0.02% =========================================== Files 21 21 Lines 6013 6017 +4 =========================================== + Hits 6013 6016 +3 - Misses 0 1 +1 ``` | [Flag](https://app.codecov.io/gh/omni-us/jsonargparse/pull/486/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | Coverage Δ | | |---|---|---| | [py3.10](https://app.codecov.io/gh/omni-us/jsonargparse/pull/486/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `88.39% <90.00%> (-0.01%)` | :arrow_down: | | [py3.10_all](https://app.codecov.io/gh/omni-us/jsonargparse/pull/486/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `98.72% <90.00%> (-0.02%)` | :arrow_down: | | [py3.10_pydantic1](https://app.codecov.io/gh/omni-us/jsonargparse/pull/486/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `48.94% <90.00%> (+0.01%)` | :arrow_up: | | [py3.10_pydantic2](https://app.codecov.io/gh/omni-us/jsonargparse/pull/486/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `48.66% <90.00%> (+0.01%)` | :arrow_up: | | [py3.10_types](https://app.codecov.io/gh/omni-us/jsonargparse/pull/486/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `98.72% <90.00%> (-0.02%)` | :arrow_down: | | [py3.11](https://app.codecov.io/gh/omni-us/jsonargparse/pull/486/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `87.66% <90.00%> (-0.73%)` | :arrow_down: | | [py3.11_all](https://app.codecov.io/gh/omni-us/jsonargparse/pull/486/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `97.82% <90.00%> (-0.92%)` | :arrow_down: | | [py3.11_types](https://app.codecov.io/gh/omni-us/jsonargparse/pull/486/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `97.82% <90.00%> (-0.92%)` | :arrow_down: | | [py3.12](https://app.codecov.io/gh/omni-us/jsonargparse/pull/486/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `88.38% <90.00%> (-0.01%)` | :arrow_down: | | [py3.12_all](https://app.codecov.io/gh/omni-us/jsonargparse/pull/486/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `98.72% <90.00%> (-0.02%)` | :arrow_down: | | [py3.12_types](https://app.codecov.io/gh/omni-us/jsonargparse/pull/486/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `98.72% <90.00%> (-0.02%)` | :arrow_down: | | [py3.7](https://app.codecov.io/gh/omni-us/jsonargparse/pull/486/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `88.96% <88.88%> (-0.01%)` | :arrow_down: | | [py3.7_all](https://app.codecov.io/gh/omni-us/jsonargparse/pull/486/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `99.48% <88.88%> (-0.02%)` | :arrow_down: | | [py3.7_types](https://app.codecov.io/gh/omni-us/jsonargparse/pull/486/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `99.46% <88.88%> (-0.02%)` | :arrow_down: | | [py3.8](https://app.codecov.io/gh/omni-us/jsonargparse/pull/486/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `89.11% <90.00%> (-0.01%)` | :arrow_down: | | [py3.8_all](https://app.codecov.io/gh/omni-us/jsonargparse/pull/486/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `99.50% <90.00%> (-0.02%)` | :arrow_down: | | [py3.8_types](https://app.codecov.io/gh/omni-us/jsonargparse/pull/486/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `99.48% <90.00%> (-0.02%)` | :arrow_down: | | [py3.9](https://app.codecov.io/gh/omni-us/jsonargparse/pull/486/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `88.96% <90.00%> (-0.01%)` | :arrow_down: | | [py3.9_all](https://app.codecov.io/gh/omni-us/jsonargparse/pull/486/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `99.36% <90.00%> (-0.02%)` | :arrow_down: | | [py3.9_types](https://app.codecov.io/gh/omni-us/jsonargparse/pull/486/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `99.36% <90.00%> (-0.02%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.