From 742f538372757fc44d7e3873c68212715f069d86 Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Sun, 5 Feb 2023 22:56:47 +0100 Subject: [PATCH] setup.py: fix Invalid version number While trying to build wors with setuptools 66 (e.g. `python3 setup.py sdist`), the following exception is raised: pkg_resources.extern.packaging.version.InvalidVersion: Invalid version: '-0.4.2-dev-71afc647-' setuptools 66 is more strict with version numbers. Since we read the Python code manually to extract the version, we also need to remove the quotes from the string literal representation. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 5fcfc355..05766c4e 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ with open(version_filename, mode="r", encoding="utf-8") as fobj: for line in fobj: if "__version__ =" in line: - version = line.strip().split("=")[-1].strip() + version = line.strip().split("=")[-1].strip().replace('"', '') utils_requirements = ["requests", "requests-cache", "tqdm"] EXTRA_REQUIREMENTS = {