Uh oh!
There was an error while loading. Please reload this page.
feat(plugins): Switch to an importlib.metadata.EntryPoint-based plugin loading - #632
Conversation
woile
commented
Dec 6, 2022
Fantastic PR! Thanks a lot for the contribution. Could you add some documentation? As you can see this would be outdated: https://commitizen-tools.github.io/commitizen/customization/#2-customize-through-customizing-a-class And if possible a migration guide from the old system, on that same page. |
8276b11 to
8e0c6f5Comparenoirbizarre
commented
Dec 6, 2022
Sorry, the branch wasn't up to date and was missing the documentation part. |
8e0c6f5 to
26707d6Comparenoirbizarre
commented
Dec 6, 2022
There it is, migration section added 👍🏼 |
Lee-W
commented
Dec 9, 2022
Looks like we'll need to wait for #633 for the CI ? |
noirbizarre
commented
Dec 9, 2022
Yes, as soon as #633 is merged, I'll rebase this PR to pass the CI (I also have some other PR not yet submitted) |
91ca554 to
741339fCompareCodecov Report
Additional details and impacted files@@ Coverage Diff @@## v3 #632 +/- ##
=====================================
Coverage ? 98.42% =====================================
Files ? 39 Lines ? 1650 Branches ? 0 =====================================
Hits ? 1624 Misses ? 26 Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
803740c to
d5048efComparenoirbizarre
commented
Dec 13, 2022
Retargetted and rebased on
|
d5048ef to
dbd27d3Compare…n loading Plugins are now loaded using the `commitizen.plugin` entrypoint while legacy plugin are not loaded anymore but a warning is raised when one is seen. Fixescommitizen-tools#495 BREAKING CHANGE: Plugins are now exposed as `commitizen.plugin` entrypoints
dbd27d3 to
83cb00eCompareLee-W
commented
Jan 18, 2023
Hi @noirbizarre I'm trying to install the plugins and test it locally. How did you do it on your local side? |
noirbizarre
commented
Jan 20, 2023
It depends:
I did the migration on https://github.com/noirbizarre/emotional but did not yet push because |
I somehow solve it on my side. Just pushed the latest v3 🙌 |
Description
This PR is proposal implementation for #495
It switches to an
importlib.metadata.EntryPoint-based plugin loading instead of pattern matching on the module name.Plugins are now loaded using the
commitizen.pluginentrypoint while legacy plugins are not loaded anymore but a warning is raised for each legacy plugin seen.BREAKING CHANGE: Plugins are now exposed as
commitizen.pluginentrypointsChecklist
./scripts/formatand./scripts/testlocally to ensure this change passes linter check and testExpected behavior
Internal plugins are exposed as
commitizen.pluginentrypoint. and seen as plugins.External plugins are seen too as soon as they are exposed as
commitizen.pluginentrypoint.Legacy plugins are not loaded and a warning is raised for each legacy plugin detected.
Steps to Test This Pull Request
Try to use any internal plugin without changes in configuration: should work
Try a legacy plugin: KO
Try a plugin migrated to the
commitizen.plugin: should workAdditional context
I chose not to have a deprecation warning on this because:
cz_namingdiscover_thisand entrypoint expose raise a bit the complexityBut I can switch to this if required:
Fixes#495