summaryrefslogtreecommitdiff
path: root/media-gfx/mypaint/files/mypaint-2.0.1-setuptools.patch
blob: 352e23aceb7db2a85c839611709af1ad44a3f44b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
https://github.com/mypaint/mypaint/commit/1e97b4e1c0ea785b527ea63bf19f8554f3a25319
https://github.com/mypaint/mypaint/commit/423950bec96d6057eac70442de577364d784a847

From 1e97b4e1c0ea785b527ea63bf19f8554f3a25319 Mon Sep 17 00:00:00 2001
From: Jan Tojnar <jtojnar@gmail.com>
Date: Wed, 6 Apr 2022 22:55:21 +0200
Subject: [PATCH] setup.py:

Setuptools 54.1.0+ complains:

    lib/python3.9/site-packages/setuptools/dist.py:732: UserWarning: Usage of dash-separated 'install-data' will not be supported in future versions. Please use the underscore name 'install_data' instead

https://github.com/pypa/setuptools/commit/a2e9ae4cb75f9b00ddf37713ec307e5f00869737
--- a/setup.cfg
+++ b/setup.cfg
@@ -7,11 +7,11 @@
 
 [install]
 verbose=1
-install-scripts=$base/bin
-install-platlib=$base/lib/mypaint
-install-purelib=$base/lib/mypaint
-install-data=$base/share
-install-headers=$base/include
+install_scripts=$base/bin
+install_platlib=$base/lib/mypaint
+install_purelib=$base/lib/mypaint
+install_data=$base/share
+install_headers=$base/include
 
 [nosetests]
 with-doctest=1

From 423950bec96d6057eac70442de577364d784a847 Mon Sep 17 00:00:00 2001
From: Jan Tojnar <jtojnar@gmail.com>
Date: Wed, 6 Apr 2022 23:13:06 +0200
Subject: [PATCH] setup.py: Ensure setuptools-compatible distutils are used
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Setuptools is warning:

    lib/python3.9/site-packages/_distutils_hack/__init__.py:17: UserWarning: Distutils was imported before Setuptools, but importing Setuptools also replaces the `distutils` module in `sys.modules`. This may lead to undesirable behaviors or errors. To avoid these issues, avoid using distutils directly, ensure that setuptools is installed in the traditional way (e.g. not an editable install), and/or make sure that setuptools is always imported before distutils.

And in fact, I am getting such errors:

    distutils.errors.DistutilsClassError: command class <class '__main__.Build'> must subclass Command

Let’s do as asked.
--- a/setup.py
+++ b/setup.py
@@ -16,9 +16,6 @@
 import shutil
 import functools
 
-from distutils.command.build import build
-from distutils.command.clean import clean
-
 from setuptools import setup
 from setuptools import Extension
 from setuptools import Command
@@ -26,6 +23,11 @@
 from setuptools.command.install import install
 from setuptools.command.install_scripts import install_scripts
 
+# setuptools must be imported first since they ensure
+# their distutils implementation will be used.
+from distutils.command.build import build
+from distutils.command.clean import clean
+
 # Constants