@@ -57,9 +57,9 @@ to improve performance when available (such modules are usually referred to as
57
57
- determine which files to modify in order to compile the project;
58
58
- determine which Makefile rules to invoke in the end.
59
59
60
- Usually, accelerator modules are added in the `` Modules/ ` ` directory of
60
+ Usually, accelerator modules are added in the :cpy-file: ` Modules ` directory of
61
61
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
63
63
place the files inside it. In our example, we will assume that we have
64
64
the following structure:
65
65
@@ -70,7 +70,7 @@ the following structure:
70
70
.. note ::
71
71
72
72
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 ``.
74
74
75
75
The following code snippets illustrate the possible contents of the above files:
76
76
@@ -209,7 +209,7 @@ too trivial.
209
209
Make the CPython project compile
210
210
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
211
211
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.
213
213
First, define the following the variables:
214
214
215
215
.. code-block :: makefile
@@ -239,31 +239,31 @@ and the following rule in the section for **Module dependencies and platform-spe
239
239
240
240
Finally, we need to modify the configuration for Windows platforms:
241
241
242
- - Open `` PC/config.c ` ` and add the prototype:
242
+ - Open :cpy-file: ` PC/config.c ` and add the prototype:
243
243
244
244
.. code-block :: c
245
245
246
246
extern PyObject* PyInit_foo(void);
247
247
248
248
and the entry ``{"foo", PyInit_foo} `` to ``_PyImport_Inittab ``.
249
249
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:
252
252
253
253
.. code-block :: xml
254
254
255
255
<ClInclude Include =" ..\Modules\foo\foomodule.h" />
256
256
257
257
In addition, add the following lines to the ``<ItemGroup> ``
258
- containing the ``..\Modules\*.c `` files:
258
+ containing the the other ``..\Modules\*.c `` files:
259
259
260
260
.. code-block :: xml
261
261
262
262
<ClCompile Include =" ..\Modules\foo\foomodule.c" />
263
263
<ClCompile Include =" ..\Modules\foo\helper.c" />
264
264
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:
267
267
268
268
.. code-block :: xml
269
269
@@ -272,7 +272,7 @@ Finally, we need to modify the configuration for Windows platforms:
272
272
</ClInclude >
273
273
274
274
In addition, add the following lines to the ``ItemGroup `` containing
275
- the ``..\Modules\*.c `` files:
275
+ the the other ``..\Modules\*.c `` files:
276
276
277
277
.. code-block :: xml
278
278
@@ -304,7 +304,7 @@ Now that everything is in place, it remains to compile the project:
304
304
know which files should be updated.
305
305
306
306
- 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 ``.
308
308
309
309
You can now compile the entire project by running the following commands:
310
310
@@ -332,6 +332,6 @@ the following can be done on Linux platforms (systemctl-based):
332
332
$ sudo systemctl start docker # start it if not!
333
333
$ sudo systemctl restart docker # or restart it!
334
334
335
- If docker complains about missing permissions, the following StackOverflow post
335
+ If Docker complains about missing permissions, the following StackOverflow post
336
336
could be useful in solving the issue: `How to fix docker: permission denied
337
337
<https://stackoverflow.com/q/48957195/9579194> `_.
0 commit comments