Package: python3.11
Version: 3.11.0-3
Severity: important
Control: affects -1 src:sunpy
The version number returned from platform.python_version() is not
conform to its documentation and is not parseable with
packaging.version.Version:
----------------------8<----------------------------------------
$ python3.11
Python 3.11.0+ (main, Nov 4 2022, 09:23:33) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
from platform import python_version
from packaging.version import Version
python_version()
'3.11.0+'
print(python_version.__doc__)
Returns the Python version as string 'major.minor.patchlevel'
Note that unlike the Python sys.version, the returned value
will always include the patchlevel (it defaults to 0).
Version(python_version())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3/dist-packages/packaging/version.py", line 266,
in __init__
raise InvalidVersion(f"Invalid version: '{version}'")
packaging.version.InvalidVersion: Invalid version: '3.11.0+'
----------------------8<----------------------------------------
This is a bug of the Debian package itself, the trailing "+" is added in
debian/patches/git-updates.diff.
Sunpy uses packaging.version.Version(python_version) to skip some tests,
which creates an error and therefore prevents Sunpy from compilation.