[PATCH] D67533: [LNT] Python 3 support: Set up (client) setup requirements

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 15 15:29:29 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL371943: [LNT] Python 3 support: Set up (client) setup requirements (authored by hubert.reinterpretcast, committed by ).
Herald added a project: LLVM.

Changed prior to commit:
  https://reviews.llvm.org/D67533?vs=220232&id=220256#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67533/new/

https://reviews.llvm.org/D67533

Files:
  lnt/trunk/lnt/testing/profile/cPerf.cpp
  lnt/trunk/requirements.client.txt
  lnt/trunk/setup.py


Index: lnt/trunk/requirements.client.txt
===================================================================
--- lnt/trunk/requirements.client.txt
+++ lnt/trunk/requirements.client.txt
@@ -7,12 +7,10 @@
 MarkupSafe==0.23
 SQLAlchemy==1.1.11
 Werkzeug==0.12.2
-argparse==1.3.0
 itsdangerous==0.24
 python-dateutil==2.6.0
 python-gnupg==0.3.7
 pytz==2016.10
-wsgiref==0.1.2
 WTForms==2.0.2
 Flask-WTF==0.12
 typing
Index: lnt/trunk/lnt/testing/profile/cPerf.cpp
===================================================================
--- lnt/trunk/lnt/testing/profile/cPerf.cpp
+++ lnt/trunk/lnt/testing/profile/cPerf.cpp
@@ -812,7 +812,25 @@
                                       "Import perf.data from a filename"},
                                      {NULL, NULL, 0, NULL}};
 
-PyMODINIT_FUNC initcPerf(void) { (void)Py_InitModule("cPerf", cPerfMethods); }
+#if PY_MAJOR_VERSION >= 3
+static PyModuleDef cPerfModuleDef = {PyModuleDef_HEAD_INIT,
+                                     "cPerf",
+                                     nullptr,
+                                     -1,
+                                     cPerfMethods,
+                                     nullptr,
+                                     nullptr,
+                                     nullptr,
+                                     nullptr};
+#endif
+
+PyMODINIT_FUNC initcPerf(void) {
+#if PY_MAJOR_VERSION >= 3
+  return PyModule_Create(&cPerfModuleDef);
+#else
+  (void)Py_InitModule("cPerf", cPerfMethods);
+#endif
+}
 
 #else // STANDALONE
 
Index: lnt/trunk/setup.py
===================================================================
--- lnt/trunk/setup.py
+++ lnt/trunk/setup.py
@@ -9,6 +9,9 @@
 import sys
 from setuptools import setup, find_packages, Extension
 
+if sys.version_info < (2, 7):
+    raise RuntimeError("Python 2.7 or higher required.")
+
 cflags = []
 
 if _platform == "darwin":
@@ -124,4 +127,6 @@
     install_requires=reqs,
 
     ext_modules=[cPerf],
+
+    python_requires='>=2.7',
 )


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67533.220256.patch
Type: text/x-patch
Size: 1997 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190915/241c4aff/attachment.bin>


More information about the llvm-commits mailing list