anntzer / defopt

Effortless argument parser
https://pypi.org/project/defopt/
MIT License
214 stars 11 forks source link

Add options parameter that replaces strict_kwonly #92

Closed mcarans closed 3 years ago

mcarans commented 3 years ago

The strict_kwonly flag only affects parameters that have a default value - when set to False, parameters with default values are accepted as keyword arguments instead of postional arguments.

Deprecate strict_kwonly and replace by options="has_default" (i.e. strict_kwonly=False), ="kwonly" (strict_kwonly=True), "all" (all parameters accepted as keyword arguments)

anntzer commented 3 years ago

As a side point, looks like a recent setuptools release broke CI. Let's see whether they fix this quickly, otherwise I'll have to fiddle with the CI config :/

anntzer commented 3 years ago

I bumped the dependency to docutils>=0.12 to fix the build, but you'll need to rebase the PR.

mcarans commented 3 years ago

@anntzer Thanks for all the good suggestions. I've done them all. Please take a look.

mcarans commented 3 years ago

@anntzer I've made the changes you suggested. Please take a look.

anntzer commented 3 years ago

Just one typo, then good to go Do you want to take care of squashing your commits yourself or should I do it?

mcarans commented 3 years ago

@anntzer I have fixed the double space. I'd be grateful if you could squash the commits.

anntzer commented 3 years ago

Merged into master as https://github.com/anntzer/defopt/commit/bcca151eea7b37996033473994076befd54ccea5. Thanks for the PR!