click-plugins icon indicating copy to clipboard operation
click-plugins copied to clipboard

Allow `with_plugins()` to accept a string

Open jvprat opened this issue 2 years ago • 0 comments

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 and pkg_resources.iter_entry_points() is called automatically. This should be backwards compatible.
  • The test_register_and_run is run for both the original good_cli and the new good_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

jvprat avatar Aug 14 '21 17:08 jvprat