diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2020-05-05 10:40:07 +0200 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2020-05-05 10:40:07 +0200 |
commit | 606313ee45d9db34893747eea7a955d9a2fee2b9 (patch) | |
tree | 75ad50a95ce8105bdee76731b06299ab7d8b2e13 | |
parent | 976893432edde8dcecca2b935399104dd74c27be (diff) | |
download | cython-606313ee45d9db34893747eea7a955d9a2fee2b9.tar.gz |
Rename embedding tests in docs to make it easier to find and select in the test suite.
-rw-r--r-- | docs/examples/tutorial/embedding/embedded.pyx (renamed from docs/examples/tutorial/embedding/spam.pyx) | 4 | ||||
-rw-r--r-- | docs/examples/tutorial/embedding/embedded_main.c (renamed from docs/examples/tutorial/embedding/spam_main.c) | 10 | ||||
-rw-r--r-- | docs/src/tutorial/embedding.rst | 8 |
3 files changed, 11 insertions, 11 deletions
diff --git a/docs/examples/tutorial/embedding/spam.pyx b/docs/examples/tutorial/embedding/embedded.pyx index d079bd029..26704d45f 100644 --- a/docs/examples/tutorial/embedding/spam.pyx +++ b/docs/examples/tutorial/embedding/embedded.pyx @@ -1,7 +1,7 @@ -# spam.pyx +# embedded.pyx # The following two lines are for test purposed only, please ignore them. -# distutils: sources = spam_main.c +# distutils: sources = embedded_main.c # tag: py3only TEXT_TO_SAY = 'Hello from Python!' diff --git a/docs/examples/tutorial/embedding/spam_main.c b/docs/examples/tutorial/embedding/embedded_main.c index a65cee7e9..36f145660 100644 --- a/docs/examples/tutorial/embedding/spam_main.c +++ b/docs/examples/tutorial/embedding/embedded_main.c @@ -1,7 +1,7 @@ -/* spam_main.c */ +/* embedded_main.c */ /* This include file is automatically generated by Cython for 'public' functions. */ -#include "spam.h" +#include "embedded.h" int main(int argc, char *argv[]) @@ -16,7 +16,7 @@ main(int argc, char *argv[]) } /* Add a built-in module, before Py_Initialize */ - if (PyImport_AppendInittab("spam", PyInit_spam) == -1) { + if (PyImport_AppendInittab("embedded", PyInit_embedded) == -1) { fprintf(stderr, "Error: could not extend in-built modules table\n"); exit(1); } @@ -31,10 +31,10 @@ main(int argc, char *argv[]) /* Optionally import the module; alternatively, import can be deferred until the embedded script imports it. */ - pmodule = PyImport_ImportModule("spam"); + pmodule = PyImport_ImportModule("embedded"); if (!pmodule) { PyErr_Print(); - fprintf(stderr, "Error: could not import module 'spam'\n"); + fprintf(stderr, "Error: could not import module 'embedded'\n"); goto exit_with_error; } diff --git a/docs/src/tutorial/embedding.rst b/docs/src/tutorial/embedding.rst index b265191cf..3f6325428 100644 --- a/docs/src/tutorial/embedding.rst +++ b/docs/src/tutorial/embedding.rst @@ -50,18 +50,18 @@ Embedding example code ====================== The following is a simple example that shows the main steps for embedding a -Cython module (``spam.pyx``) in Python 3.x. +Cython module (``embedded.pyx``) in Python 3.x. First, here is a Cython module that exports a C function to be called by external code. Note that the ``say_hello_from_python()`` function is declared as ``public`` to export it as a linker symbol that can be used by other C files, which in this -case is ``spam_main.c``. +case is ``embedded_main.c``. -.. literalinclude:: ../../examples/tutorial/embedding/spam.pyx +.. literalinclude:: ../../examples/tutorial/embedding/embedded.pyx The C ``main()`` function of your program could look like this: -.. literalinclude:: ../../examples/tutorial/embedding/spam_main.c +.. literalinclude:: ../../examples/tutorial/embedding/embedded_main.c :linenos: :language: c |