Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace pkg_resources #31

Merged
merged 7 commits into from
Mar 5, 2025
Merged

Replace pkg_resources #31

merged 7 commits into from
Mar 5, 2025

Conversation

gforcada
Copy link
Member

@gforcada gforcada commented Mar 3, 2025

See plone/Products.CMFPlone#4126

Warning

tests are failing, if you remove the last commit, tests run fine, but there is pkg_resources still to be removed 🤷🏾

This is needed for entry points.
In `example.ploneintegration`, the `example.addon` zcml gets loaded.
In `example.zopeintegration`, the `example.addon` and `example.multipleeps` zcml gets loaded.
This is because `example.{addon,multipleeps}/setup.py` has a strange entry point:

```
[z3c.autoinclude.plugin]
dummy = dummy
```

This was added to check if our code can handle unexpected entry point contents without breaking.
I don't really mind whether the zcml of these packages gets loaded or not, as this should not happen in practice.
But the new way of getting the available distributions and their entry points, apparently has this as side effect.
@coveralls
Copy link

Pull Request Test Coverage Report for Build 13656371879

Details

  • 24 of 25 (96.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.6%) to 98.328%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/plone/autoinclude/loader.py 24 25 96.0%
Totals Coverage Status
Change from base Build 13613192891: -0.6%
Covered Lines: 231
Relevant Lines: 233

💛 - Coveralls

Copy link
Member

@mauritsvanrees mauritsvanrees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for starting this. I have made a fix in commit 5876289: on Python 3.9 we really must use the entry_points from importlib_metadata, instead of the built in importlib.metadata.

And then the tests needed fixing because the new code finds a few more zcml files to load, but this should be fine.

@gforcada
Copy link
Member Author

gforcada commented Mar 4, 2025

Thanks for finishing the code!

@gforcada
Copy link
Member Author

gforcada commented Mar 4, 2025

@jenkins-plone-org please run jobs

@gforcada gforcada merged commit 0bc973c into main Mar 5, 2025
20 checks passed
@gforcada gforcada deleted the 4126-replace-pkg-resources branch March 5, 2025 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants