File: 003-rm-distutils-from-setup.patch

package info (click to toggle)
python-memray 1.17.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 24,396 kB
  • sloc: python: 28,451; ansic: 16,507; sh: 10,586; cpp: 8,494; javascript: 1,474; makefile: 822; awk: 12
file content (83 lines) | stat: -rw-r--r-- 2,820 bytes parent folder | download
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
75
76
77
78
79
80
81
82
83
Description: Remove use of distutils from setup.py files
 Removed the use of distutils from various setup.py files
 + defined packages, package_data to include shared objects.
Forwarded: not-needed
Author: Yogeswaran Umasankar <yogu@debian.org>
Last-Update: 2024-04-06

--- a/setup.py
+++ b/setup.py
@@ -1,8 +1,7 @@
-import distutils.command.build
-import distutils.log
 import os
 import pathlib
 import subprocess
+import logging
 import sys
 import tempfile
 from sys import platform
@@ -42,10 +41,7 @@ class BuildMemray(build_ext_orig):
         super().run()
 
     def announce_and_run(self, command, **kwargs):
-        self.announce(
-            "executing command: `{}`".format(" ".join(command)),
-            level=distutils.log.INFO,
-        )
+        logging.info("executing command: `%s`", " ".join(command))
         subprocess.run(command, check=True, **kwargs)
 
     def build_libbacktrace(self):
@@ -326,13 +320,17 @@ setup(
     ],
     license="Apache 2.0",
     package_dir={"": "src"},
-    packages=find_packages(where="src", exclude="memray/_memray/"),
+    packages=find_packages(where="src") + ['memray._memray'] + ['memray.reporters.templates.assets'],
     ext_modules=cythonize(
         [MEMRAY_EXTENSION, MEMRAY_TEST_EXTENSION, MEMRAY_INJECT_EXTENSION],
         include_path=["src/memray"],
         compiler_directives=COMPILER_DIRECTIVES,
     ),
     include_package_data=True,
+    package_data={
+        "memray._memray": ["*.so"],
+        "memray.reporters.templates.assets": ["*"],
+    },
     install_requires=install_requires,
     extras_require={
         "test": test_requires,
--- a/tests/integration/misbehaving_extension/setup.py
+++ b/tests/integration/misbehaving_extension/setup.py
@@ -1,7 +1,6 @@
 import os
 import sysconfig
-from distutils.core import Extension
-from distutils.core import setup
+from setuptools import setup, Extension
 
 ROOT = os.path.realpath(os.path.dirname(__file__))
 LDSHARED = os.environ.get("LDSHARED", sysconfig.get_config_var("LDSHARED"))
--- a/tests/integration/multithreaded_extension/setup.py
+++ b/tests/integration/multithreaded_extension/setup.py
@@ -1,7 +1,6 @@
 import os
 import sysconfig
-from distutils.core import Extension
-from distutils.core import setup
+from setuptools import setup, Extension
 
 ROOT = os.path.realpath(os.path.dirname(__file__))
 LDSHARED = os.environ.get("LDSHARED", sysconfig.get_config_var("LDSHARED"))
--- a/tests/integration/native_extension/setup.py
+++ b/tests/integration/native_extension/setup.py
@@ -1,7 +1,6 @@
 import os
 import sysconfig
-from distutils.core import Extension
-from distutils.core import setup
+from setuptools import setup, Extension
 
 ROOT = os.path.realpath(os.path.dirname(__file__))
 LDSHARED = os.environ.get("LDSHARED", sysconfig.get_config_var("LDSHARED"))