-
Notifications
You must be signed in to change notification settings - Fork 43
Description
$ click-man cve
Traceback (most recent call last):
File "[...]/cvelib/.venv/bin/click-man", line 10, in
sys.exit(cli())
~~~^^
File "[...]/cvelib/.venv/lib64/python3.13/site-packages/click/core.py", line 1442, in call
return self.main(*args, **kwargs)
~~~~~~~~~^^^^^^^^^^^^^^^^^
File "[...]/cvelib/.venv/lib64/python3.13/site-packages/click/core.py", line 1363, in main
rv = self.invoke(ctx)
File "[...]/cvelib/.venv/lib64/python3.13/site-packages/click/core.py", line 1226, in invoke
return ctx.invoke(self.callback, **ctx.params)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "[...]/cvelib/.venv/lib64/python3.13/site-packages/click/core.py", line 794, in invoke
return callback(*args, **kwargs)
File "[...]/cvelib/.venv/lib64/python3.13/site-packages/click_man/shell.py", line 80, in cli
man_version = entry_point.version
^^^^^^^^^^^^^^^^^^^
AttributeError: 'EntryPoint' object has no attribute 'version'
My pyproject.toml:
[project.scripts]
cve = "cvelib.cli:cli"
The EntryPoints class does not have a version attribute:
https://github.com/python/cpython/blob/6260b6ae24e11b3d338c72f0391de442756e33ca/Lib/importlib/metadata/__init__.py#L250
This bug was probably introduced here:
b1c4695
Workaround is to explicitly call the --man-version option.
Option for a fix is to use the importlib.metadata.version() function instead:
https://github.com/python/cpython/blob/1bbf7b661f0ac8aac12d5531928d9a85c98ec1a9/Lib/importlib/metadata/__init__.py#L357