Skip to content

Fix tests now that setuptools 82 is out.#46

Merged
mauritsvanrees merged 15 commits into
mainfrom
maurits-no-pkg_resources-in-test-packages
Feb 18, 2026
Merged

Fix tests now that setuptools 82 is out.#46
mauritsvanrees merged 15 commits into
mainfrom
maurits-no-pkg_resources-in-test-packages

Conversation

@mauritsvanrees

Copy link
Copy Markdown
Member

In PR #44 the unit/integration two weeks ago the tests passed:
https://github.com/plone/plone.autoinclude/actions/runs/21561303563

I merged that PR yesterday, and then they failed:
https://github.com/plone/plone.autoinclude/actions/runs/21924186549
This is because setuptools 82 is out, without pkg_resources.

Overview of changes:

  • Change most test packages to use native namespaces.
  • Still test with one with pkg_resources (with setuptools<82 as build-system) and one with pkgutil style namespaces.
  • After doing this, the unit tests failed, but if you first ran the integration tests, the unit tests would pass. Refactored this to not need arcane distutils code in test_loader.py.
  • Define owncoverage tox env instead of the standard coverage env from plone.meta, as our setup is too different.

Get rid of arcane incantations in test_loader.py.
Now that we have removed the arcane setup code from test_loader.py, we need to have all test-packages installed already.
This explicitly uses `setuptools<82` as `build-system`, otherwise the `pkg_resources` module is not available.
I want to be able to test that these kinds of packages are also found.
Otherwise the tests fail, because neither pip nor buildout can handle the combination of namespace package styles in development.

Alternatively we could add `horse-with-no-namespace`.  I tried and it works.  But I prefer not to rely on it in these tests.
Our setup is too different to use the standard one from plone.meta.
@mister-roboto

Copy link
Copy Markdown

@mauritsvanrees thanks for creating this Pull Request and helping to improve Plone!

TL;DR: Finish pushing changes, pass all other checks, then paste a comment:

@jenkins-plone-org please run jobs

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically.

Happy hacking!

@mauritsvanrees

Copy link
Copy Markdown
Member Author

This works, but we should remove the test matrix and just rely on our own config. But that requires some work in plone.meta which I will look at first.

We need our test-packages installed, due to the recent changes in `test_loader.py`.

We don't have many dependencies, so using the dist.plone.org constraints would not bring us much either.
These are installed in a tox env:

```
setuptools==82.0.0
zope-configuration==7.0
zope-event==6.1
zope-exceptions==6.0
zope-i18nmessageid==8.2
zope-interface==8.2
zope-schema==8.1
zope-testrunner==8.2
```
We have our `owncoverage` job for this.
mauritsvanrees added a commit to plone/meta that referenced this pull request Feb 12, 2026
When false, don't use the test matrix.
I use this option in plone/plone.autoinclude#46 in commit f825429a04ba060a9209ed7447f5e5429993f605.
See failing tests at https://github.com/plone/plone.autoinclude/actions/runs/21947076544 when using the test matrix.
@mauritsvanrees

Copy link
Copy Markdown
Member Author

Done, all green.

Jenkins is not needed: the plone.autoinclude tests are not run there, for the same reason why I have removed the test matrix here: its tests can only pass when the test packages are installed, and that is something we should do on Jenkins.

@mauritsvanrees
mauritsvanrees merged commit c4ed123 into main Feb 18, 2026
19 of 21 checks passed
@mauritsvanrees
mauritsvanrees deleted the maurits-no-pkg_resources-in-test-packages branch February 18, 2026 14:34
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