Use of entry points violates specification
According to the entry points specification, the value of an entry point must be an object reference, i.e. a string of either the form importable.module
or importable.module:nested.object
. Contrary to that, cmmnbuild-dep-manager stores a version string in the entry point value. Example from PjLSA:
# entry-points.txt
[cmmnbuild_dep_manager]
pjlsa = 0.2.18
Of course, this is an entirely pedantic point. However, some of the more modern tools have actually started verifying this requirement.
I found this issue when trying to switch a downstream pjlsa fork from setup.py to pyproject.toml. While the setup.py backend accepts the entry point, the pyproject.toml backend uses the build
package, which fully validates the entry points.
Minimal reproduction:
# pyproject.toml
[build-system]
requires = ['setuptools']
build-backend = 'setuptools.build_meta'
[project]
name = 'foo'
version = '1.0'
entry-points = {foo={foo='1.0'}}
Running pip install .
produces a lengthy error with this core message:
configuration error: `project.entry-points.foo.foo` must be python-entrypoint-reference
As far as I can tell, the motivation for storing the version number in the entry point is the distinction between distribution packages and import packages. In theory, it would be possible for one distribution package to provide multiple import packages, each with their own version:
# my-dist/pyproject.toml
[project]
name = 'my-dist'
version = '1.0'
[project.entry-points.cmmnbuild_dep_manager]
my_package_a = '2.0'
my_package_b = '3.0'
# my-dist/src/my_package_a/__init__.py
__version__ = '2.0'
__cmmnbuild_deps__ = [...]
__gradle_deps__ = [...]
# my-dist/src/my_package_b/__init__.py
__version__ = '3.0'
__cmmnbuild_deps__ = [...]
__gradle_deps__ = [...]
In practice, I'm not aware of any package in the ecosystem making use of this flexibility.
Is this a problem worth tackling? If yes, I'm sure solutions could be found for those distribution packages that do need to encode a distinct import package version in the entry point.