Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 26a18eb

Browse filesBrowse files
authored
Update extension-modules.rst
1 parent 5a9a57c commit 26a18eb
Copy full SHA for 26a18eb

File tree

Expand file treeCollapse file tree

1 file changed

+13
-13
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+13
-13
lines changed

‎developer-workflow/extension-modules.rst

Copy file name to clipboardExpand all lines: developer-workflow/extension-modules.rst
+13-13Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ to improve performance when available (such modules are usually referred to as
5757
- determine which files to modify in order to compile the project;
5858
- determine which Makefile rules to invoke in the end.
5959

60-
Usually, accelerator modules are added in the ``Modules/`` directory of
60+
Usually, accelerator modules are added in the :cpy-file:`Modules` directory of
6161
the CPython project. If more than one file is needed for the extension
62-
module, it is convenient to create a sub-directory in ``Modules/``, and
62+
module, it is convenient to create a sub-directory in :cpy-file:`Modules`, and
6363
place the files inside it. In our example, we will assume that we have
6464
the following structure:
6565

@@ -70,7 +70,7 @@ the following structure:
7070
.. note::
7171

7272
If ``Modules/foo/foomodule.c`` contains some Argument Clinic directives,
73-
the corresponding header file is written to ``Modules/clinic/foomodule.c.h``.
73+
the corresponding header file is written to ``Modules/foo/clinic/foomodule.c.h``.
7474

7575
The following code snippets illustrate the possible contents of the above files:
7676

@@ -209,7 +209,7 @@ too trivial.
209209
Make the CPython project compile
210210
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
211211

212-
Now that we have our files, we need to update the ``Makefile.pre.in`` file.
212+
Now that we have our files, we need to update the :cpy-file:`Makefile.pre.in` file.
213213
First, define the following the variables:
214214

215215
.. code-block:: makefile
@@ -239,31 +239,31 @@ and the following rule in the section for **Module dependencies and platform-spe
239239

240240
Finally, we need to modify the configuration for Windows platforms:
241241

242-
- Open ``PC/config.c`` and add the prototype:
242+
- Open :cpy-file:`PC/config.c` and add the prototype:
243243

244244
.. code-block:: c
245245
246246
extern PyObject* PyInit_foo(void);
247247
248248
and the entry ``{"foo", PyInit_foo}`` to ``_PyImport_Inittab``.
249249

250-
- Open ``PCbuild/pythoncore.vcxproj`` and add the following line to
251-
the ``<ItemGroup>`` containing the ``..\Modules\*.h`` files:
250+
- Open :cpy-file:`PCbuild/pythoncore.vcxproj` and add the following line to
251+
the ``<ItemGroup>`` containing the other ``..\Modules\*.h`` files:
252252

253253
.. code-block:: xml
254254
255255
<ClInclude Include="..\Modules\foo\foomodule.h" />
256256
257257
In addition, add the following lines to the ``<ItemGroup>``
258-
containing the ``..\Modules\*.c`` files:
258+
containing the the other ``..\Modules\*.c`` files:
259259

260260
.. code-block:: xml
261261
262262
<ClCompile Include="..\Modules\foo\foomodule.c" />
263263
<ClCompile Include="..\Modules\foo\helper.c" />
264264
265-
- Open ``PCbuild/pythoncore.vcxproj.filters`` and add the following line to
266-
the ``ItemGroup`` containing the ``..\Modules\*.h`` files:
265+
- Open :cpy-file:`PCbuild/pythoncore.vcxproj.filters` and add the following line to
266+
the ``ItemGroup`` containing the the other ``..\Modules\*.h`` files:
267267

268268
.. code-block:: xml
269269
@@ -272,7 +272,7 @@ Finally, we need to modify the configuration for Windows platforms:
272272
</ClInclude>
273273
274274
In addition, add the following lines to the ``ItemGroup`` containing
275-
the ``..\Modules\*.c`` files:
275+
the the other ``..\Modules\*.c`` files:
276276

277277
.. code-block:: xml
278278
@@ -304,7 +304,7 @@ Now that everything is in place, it remains to compile the project:
304304
know which files should be updated.
305305

306306
- The ``regen-stdlib-module-names`` updates the standard module names,
307-
making ``_foo`` discoverable and importable via ``import _foo``!
307+
making ``_foo`` discoverable and importable via ``import _foo``.
308308

309309
You can now compile the entire project by running the following commands:
310310

@@ -332,6 +332,6 @@ the following can be done on Linux platforms (systemctl-based):
332332
$ sudo systemctl start docker # start it if not!
333333
$ sudo systemctl restart docker # or restart it!
334334
335-
If docker complains about missing permissions, the following StackOverflow post
335+
If Docker complains about missing permissions, the following StackOverflow post
336336
could be useful in solving the issue: `How to fix docker: permission denied
337337
<https://stackoverflow.com/q/48957195/9579194>`_.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.