python/python3-daemon: Temp workaround for new setuptools.

Problem is upstream and they are aware.

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
fourtysixandtwo 2024-09-09 12:43:56 -06:00 committed by Willy Sudiarto Raharjo
parent 8bbb7a1477
commit 027439995d
No known key found for this signature in database
GPG Key ID: 3F617144D7238786
2 changed files with 78 additions and 0 deletions

View File

@ -0,0 +1,73 @@
From 3bbc46967d35cd7e05677018bdc9d552efaeea3e Mon Sep 17 00:00:00 2001
From: Ben Finney <ben+python@benfinney.id.au>
Date: Mar 08 2023 07:02:47 +0000
Subject: Use explicitly-maintained packaging.version for version string parsing.
---
#diff --git a/ChangeLog b/ChangeLog
#index bba4b5a..f5ee1e0 100644
#--- a/ChangeLog
#+++ b/ChangeLog
#@@ -14,9 +14,14 @@ Version NEXT
# :Released: FUTURE
# :Maintainer: UNKNOWN <unknown@example.org>
#
#-Changes:
#+Bugs Fixed:
#+
#+* Migrate to use the explicitly-maintained packaging library.
#+
#+ The package bundled in setuptools.extern.packaging is to help make that
#+ package self-contained, but is not a supported API.
#
#-* None.
#+ Closes: Pagure #73. Thanks to Michał Górny for the report.
#
#
# Version 3.0.1
diff --git a/test_version.py b/test_version.py
index c43cd36..d6095e4 100644
--- a/test_version.py
+++ b/test_version.py
@@ -20,10 +20,10 @@ import unittest.mock
import docutils
import docutils.nodes
import docutils.writers
+from packaging.version import InvalidVersion
import setuptools
import setuptools.command
import setuptools.dist
-from setuptools.extern.packaging.version import InvalidVersion
import testscenarios
import testtools
diff --git a/version.py b/version.py
index 20d3ef3..2d7d048 100644
--- a/version.py
+++ b/version.py
@@ -31,12 +31,12 @@ import re
import sys
import textwrap
+import packaging.version
import setuptools
import setuptools.command.build
import setuptools.command.build_py
import setuptools.command.egg_info
import setuptools.dist
-import setuptools.extern.packaging.version
def ensure_class_bases_begin_with(namespace, class_name, base_class):
@@ -186,7 +186,7 @@ class ChangeLogEntry:
# A valid non-version value.
return None
- valid_version = setuptools.extern.packaging.version.Version(value)
+ valid_version = packaging.version.Version(value)
@classmethod
def validate_maintainer(cls, value):

View File

@ -80,6 +80,11 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
# 46and2: needs following patch minus Changelog fix or will not build
# https://pagure.io/python-daemon/c/3bbc4696
# upstream is still working on proper fix, see issue #94
patch -p1 < $CWD/packaging-version.patch
PYVER=$(python3 -c 'import sys; print("%d.%d" % sys.version_info[:2])')
export PYTHONPATH=/opt/python$PYVER/site-packages/