python-apt: fix pep440 issue in version.

This commit is contained in:
Ark74 2026-01-18 03:50:18 -06:00
parent 9b27956b30
commit b1dafba4a7
2 changed files with 28 additions and 2 deletions

View file

@ -0,0 +1,23 @@
diff --git a/setup.py b/setup.py
index 9648d871..a63a2c66 100644
--- a/setup.py
+++ b/setup.py
@@ -6,6 +6,7 @@ import os
import shutil
import subprocess
import sys
+import re
from setuptools import Extension, setup
from setuptools.command.install import install
@@ -64,6 +64,10 @@ def get_version():
version = version.replace("tanglu", "+tanglu")
version = version.split("build")[0]
+ # Trisquel-style suffix: "3.1.0trisquel12" -> "3.1.0+trisquel12" (PEP 440 local)
+ if "+" not in version:
+ version = re.sub(r"(?<=\d)([A-Za-z])", r"+\1", version, count=1)
+
return version

View file

@ -24,7 +24,7 @@
# list available on the resulting netinstall (mini.iso) image.
# The same way as 'ubiquity' is for for the next Live Desktop ISOs.
VERSION=12
VERSION=13
EXTERNAL='deb-src http://archive.ubuntu.com/ubuntu resolute main'
REPOKEY=871920D1991BC93C
COMPONENT=main
@ -89,9 +89,12 @@ diff -ru source.orig/apt/progress/base.py source/apt/progress/base.py
self.percent = float(percent)
EOF
apply_patch_changes
export DEB_BUILD_OPTIONS=nocheck
changelog "Compiled for Trisquel"
changelog "Compiled for Trisquel
Fixed PEP440 version issue."
package