[PATCH] D67533: [LNT] Python 3 support: Set up (client) setup requirements
Hubert Tong via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Sep 14 14:38:04 PDT 2019
hubert.reinterpretcast updated this revision to Diff 220232.
hubert.reinterpretcast added a comment.
- Require 2.7 or higher; remove `argparse` and `wsgiref`
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D67533/new/
https://reviews.llvm.org/D67533
Files:
lnt/testing/profile/cPerf.cpp
requirements.client.txt
setup.py
Index: setup.py
===================================================================
--- setup.py
+++ 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',
)
Index: requirements.client.txt
===================================================================
--- requirements.client.txt
+++ 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/testing/profile/cPerf.cpp
===================================================================
--- lnt/testing/profile/cPerf.cpp
+++ 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67533.220232.patch
Type: text/x-patch
Size: 1907 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190914/529aa4d7/attachment.bin>
More information about the llvm-commits
mailing list