Added
Link Here
|
1 |
From 1b7fac1599a50c970fdef49abca7151cb11bdcd0 Mon Sep 17 00:00:00 2001 |
2 |
From: Pedro Algarvio <palgarvio@vmware.com> |
3 |
Date: Tue, 11 Oct 2022 21:19:21 +0100 |
4 |
Subject: [PATCH] Disable the setuptools user warning "Setuptools is replacing |
5 |
distutils." |
6 |
|
7 |
Once we stop relying on distutils, this filter can be removed. |
8 |
|
9 |
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com> |
10 |
--- |
11 |
salt/__init__.py | 8 ++++++++ |
12 |
setup.py | 2 ++ |
13 |
2 files changed, 10 insertions(+) |
14 |
|
15 |
diff --git a/salt/__init__.py b/salt/__init__.py |
16 |
index ebc54ac8443c..ec551abbc62a 100644 |
17 |
--- salt/__init__.py |
18 |
+++ salt/__init__.py |
19 |
@@ -69,6 +69,14 @@ def load_module(self, name): |
20 |
append=True, |
21 |
) |
22 |
|
23 |
+# Filter the setuptools UserWarning until we stop relying on distutils |
24 |
+warnings.filterwarnings( |
25 |
+ "ignore", |
26 |
+ message="Setuptools is replacing distutils.", |
27 |
+ category=UserWarning, |
28 |
+ module="_distutils_hack", |
29 |
+) |
30 |
+ |
31 |
|
32 |
def __define_global_system_encoding_variable__(): |
33 |
import sys |
34 |
diff --git a/setup.py b/setup.py |
35 |
index 0fac50ab4bc6..9d994ac8730c 100755 |
36 |
--- setup.py |
37 |
+++ setup.py |
38 |
@@ -4,6 +4,8 @@ |
39 |
""" |
40 |
|
41 |
# pylint: disable=file-perms,resource-leakage |
42 |
+import setuptools # isort:skip |
43 |
+ |
44 |
import contextlib |
45 |
import distutils.dist |
46 |
import glob |
47 |
|