slackbuilds/python/python3-daemon/packaging-version.patch

74 lines
2.0 KiB
Diff
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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):