click-plugins
click-plugins copied to clipboard
Allow `with_plugins()` to accept a string
This adds support for passing an endpoint name to with_plugins()
, as proposed in https://github.com/click-contrib/click-plugins/issues/13:
- If the
plugins
parameter is a string, it's interpreted as an endpoint name andpkg_resources.iter_entry_points()
is called automatically. This should be backwards compatible. - The
test_register_and_run
is run for both the originalgood_cli
and the newgood_cli_by_name
. - Most uses of
with_plugins
were updated to pass the endpoint name (I think this is easier to use and it should be preferred for most use cases). I kept the explanation for both approaches in the README.
I took the chance to extend the Travis config to run the tests on Python 3.8 & 3.9. I also tried adding click 8 to the tests, but this version dropped support for Python < 3.6, so the tests on previous Python versions failed (I guess these combinations could be excluded, but that was not trivial so I reverted it).
Fix: #13