diff options
author | atomlong | 2021-10-23 17:55:22 +0800 |
---|---|---|
committer | atomlong | 2021-10-23 18:06:15 +0800 |
commit | 80096c8de4b34ec1ed8f30bb428918cd592b2424 (patch) | |
tree | b48dd1e73de9ea35a4709fb6b93deb16331ec514 /0100-Add-a-test-to-build-C-Ext.patch | |
parent | 89a67c05174951d172252b1db96ff93cc4ec4bcd (diff) | |
download | aur-mingw-w64-python.tar.gz |
update to 3.9.7
Diffstat (limited to '0100-Add-a-test-to-build-C-Ext.patch')
-rw-r--r-- | 0100-Add-a-test-to-build-C-Ext.patch | 108 |
1 files changed, 0 insertions, 108 deletions
diff --git a/0100-Add-a-test-to-build-C-Ext.patch b/0100-Add-a-test-to-build-C-Ext.patch deleted file mode 100644 index 067b44628949..000000000000 --- a/0100-Add-a-test-to-build-C-Ext.patch +++ /dev/null @@ -1,108 +0,0 @@ -From 30080e89858fc1ae343eea6ba2d2bf152257a458 Mon Sep 17 00:00:00 2001 -From: Naveen M K <naveen521kk@gmail.com> -Date: Tue, 29 Jun 2021 18:24:37 +0530 -Subject: [PATCH 100/N] Add a test to build C-Ext - ---- - .github/workflows/smoketests.py | 85 +++++++++++++++++++++++++++++++++ - 1 file changed, 85 insertions(+) - -diff --git a/.github/workflows/smoketests.py b/.github/workflows/smoketests.py -index 9277c14..1761724 100644 ---- a/.github/workflows/smoketests.py -+++ b/.github/workflows/smoketests.py -@@ -123,6 +123,91 @@ class Tests(unittest.TestCase): - from time import mktime, gmtime - mktime(gmtime()) - -+ def test_c_ext_build(self): -+ import tempfile -+ import sys -+ import subprocess -+ import textwrap -+ from pathlib import Path -+ -+ with tempfile.TemporaryDirectory() as tmppro: -+ subprocess.check_call([sys.executable, "-m", "ensurepip", "--user"]) -+ with Path(tmppro, "setup.py").open("w") as f: -+ f.write( -+ textwrap.dedent( -+ """\ -+ from setuptools import setup, Extension -+ -+ setup( -+ name='cwrapper', -+ version='1.0', -+ ext_modules=[ -+ Extension( -+ 'cwrapper', -+ sources=['cwrapper.c']), -+ ], -+ ) -+ """ -+ ) -+ ) -+ with Path(tmppro, "cwrapper.c").open("w") as f: -+ f.write( -+ textwrap.dedent( -+ """\ -+ #include <Python.h> -+ static PyObject * -+ helloworld(PyObject *self, PyObject *args) -+ { -+ printf("Hello World\\n"); -+ return Py_None; -+ } -+ static PyMethodDef -+ myMethods[] = { -+ { "helloworld", helloworld, METH_NOARGS, "Prints Hello World" }, -+ { NULL, NULL, 0, NULL } -+ }; -+ static struct PyModuleDef cwrapper = { -+ PyModuleDef_HEAD_INIT, -+ "cwrapper", -+ "Test Module", -+ -1, -+ myMethods -+ }; -+ -+ PyMODINIT_FUNC -+ PyInit_cwrapper(void) -+ { -+ return PyModule_Create(&cwrapper); -+ } -+ """ -+ ) -+ ) -+ subprocess.check_call( -+ [sys.executable, "-c", "import struct"], -+ ) -+ subprocess.check_call( -+ [ -+ sys.executable, -+ "-m", -+ "pip", -+ "install", -+ "wheel", -+ ], -+ ) -+ subprocess.check_call( -+ [ -+ sys.executable, -+ "-m", -+ "pip", -+ "install", -+ tmppro, -+ ], -+ ) -+ subprocess.check_call( -+ [sys.executable, "-c", "import cwrapper"], -+ ) -+ -+ - - def suite(): - return unittest.TestLoader().loadTestsFromName(__name__) --- -2.32.0 - |