Tox and release-check ModuleNotFoundError: No module named 'zope'

in my tox file based on plone/meta i have a section for release check

[testenv:release-check]
description = ensure that the distribution is ready to release
skip_install = true
deps =
  twine
  build
  towncrier
  -c https://dist.plone.org/release/6.1-dev/constraints.txt

commands =
  # fake version to not have to install the package
  # we build the change log as news entries might break
  # the README that is displayed on PyPI
  towncrier build --version=100.0.0 --yes
  python -m build --sdist
  twine check dist/*

if i run

tox -e release-check

it ends with an error:

from zope.i18nmessageid import MessageFactory
ModuleNotFoundError: No module named 'zope'
ERROR: InvocationError for command /opt/Development/collective/collective_tinymce_accordion_filter/.tox/release-check/bin/towncrier build --version=100.0.0 --yes (exited with code 1)

I see that the https://dist.plone.org/release/6.1-dev/constraints.txt includes -c https://zopefoundation.github.io/Zope/releases/5.9/constraints.txt . This file contains the missing package zope.i18nmessageid.

Does anybody know, why the constraints.txt from zopefoundation.github.io is not evaluated?

Update
My current workaround is add the package zope.i18nmessageid to the deps in the release-check section.

deps =
    twine
    build
    towncrier
    zope.i18nmessageid
    -c https://dist.plone.org/release/6.1-dev/constraints.txt

:thinking:

The commands executed are:

  • towncrier XXX does not need zope.i18nmessageid
  • python -m build --sdist which should not need zope.i18nmessageid unless on setup.py you have some imports to your code that eventually lead to importing zope.i18nmessageid
  • twine XXX does not need zope.i18nmessageid

Could it be that in your setup.py you are importing the package itself to get its version, or some other details of the package, and on that very same file, or a dependency of that file you also zope.i18nmessageid?

Yes i have some entries in the setup.py. i have run tox -e dependencies and add the listed packages to the setup.py

@gforcada
you can see the error in this package:

This is my first addon in the collective workspace. i have minimal skills to provied a release ready package and i need a little bit help.