launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #31240
[Merge] ~tushar5526/launchpad-buildd:version-compatibilty-acc-to-pep-440 into launchpad-buildd:master
Tushar Gupta has proposed merging ~tushar5526/launchpad-buildd:version-compatibilty-acc-to-pep-440 into launchpad-buildd:master.
Commit message:
fix: python packaging issue for Noble, setuptools > 66 mandates PEP 440 to be followed while versioning python packages
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~tushar5526/launchpad-buildd/+git/launchpad-buildd/+merge/470099
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~tushar5526/launchpad-buildd:version-compatibilty-acc-to-pep-440 into launchpad-buildd:master.
diff --git a/setup.py b/setup.py
index e478581..85cac1f 100755
--- a/setup.py
+++ b/setup.py
@@ -30,8 +30,20 @@ with open("debian/changelog") as changelog:
raise ValueError(
"Failed to parse first line of debian/changelog: '%s'" % line
)
+
version = match.group(1)
+ # Versions are picked from debian/changelog file.
+ # With setuptools >= 66, it's mandated to follow PEP 440
+ # based versioning for python packages
+ try:
+ # version naming on Launchpad recipe,
+ # follows {debupstream}~{revno}~{ubuntu-release-suffix}
+ # we just need the {debupstream}
+ version = version.split("~")[0]
+ except IndexError:
+ raise ValueError("Invalid version format in debian/changelog")
+
setup(
name="launchpad-buildd",
Follow ups