File Adjust-the-setup.py-install-deprecation-message.patch of Package python-setuptools

From 9335d04a858bd7cb23c240be7afee3a599809ff1 Mon Sep 17 00:00:00 2001
From: Lumir Balhar <lbalhar@redhat.com>
Date: Wed, 12 Mar 2025 16:57:37 +0100
Subject: [PATCH] Adjust the setup.py install deprecation message and URL

But only when building RPM packages.
---
 setuptools/command/install.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/setuptools/command/install.py b/setuptools/command/install.py
index 19ca601..1e54326 100644
--- a/setuptools/command/install.py
+++ b/setuptools/command/install.py
@@ -55,14 +55,20 @@ class install(orig.install):
     _nc = dict(new_commands)
 
     def initialize_options(self):
+        import os
         SetuptoolsDeprecationWarning.emit(
             "setup.py install is deprecated.",
             """
             Please avoid running ``setup.py`` directly.
             Instead, use pypa/build, pypa/installer or other
             standards-based tools.
-            """,
-            see_url="https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html",
+            """
+            + ("""
+            Follow the current Python packaging guidelines when building
+            Python RPM packages.
+            """ if "RPM_BUILD_ROOT" in os.environ else ""),
+            see_url=("https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html" +
+            ("\nand https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/" if "RPM_BUILD_ROOT" in os.environ else "")),
             due_date=(2025, 10, 31),
         )
 
-- 
2.51.0

openSUSE Build Service is sponsored by