Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
setup.py: make version comply with PEP-440
Generating Python package version from git description makes a sensible string, but it does not comply with PEP-440. Starting from version 66, setuptools are very strict, and refuse to return result to _any_ python package, if at least one _unrelated_ package installed in the system has version that is not compliant with PEP-440. Because the version of syncthing-gtk is not PEP-440 compliant, when it is installed from a .deb package (as opposed to in a venv/snap), system-wide `aptdaemon` crashes, and GUI upgrader cannot install any updates on the system at all: File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1044, in __init__ self.scan(search_path) File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1077, in scan self.add(dist) File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1096, in add dists.sort(key=operator.attrgetter('hashcmp'), reverse=True) File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2631, in hashcmp self.parsed_version, ^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2679, in parsed_version self._parsed_version = parse_version(self.version) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pkg_resources/_vendor/packaging/version.py", line 266, in __init__ raise InvalidVersion(f"Invalid version: '{version}'") pkg_resources.extern.packaging.version.InvalidVersion: Invalid version: 'v0.9.4.4-ds-git20221205-12a9702d29ab' (package: syncthing-gtk) This change brings the version as used for Python package to compliance with PEP-440. This fixes apdaemon crash, and the distro can be upgraded again. Signed-off-by: Eugene Crosser <[email protected]>
- Loading branch information