@@ -10,10 +10,44 @@ The ``pythoncapi-compat`` project can be used to write a C extension supporting
10
10
a wide range of Python versions with a single code base. It is made of the
11
11
``pythoncapi_compat.h `` header file and the ``upgrade_pythoncapi.py `` script.
12
12
13
- * Homepage: `GitHub pythoncapi-compat project
14
- <https://github.com/python/pythoncapi-compat> `_.
15
- * `Documentation
16
- <https://pythoncapi-compat.readthedocs.io/en/latest/> `_
13
+ ``upgrade_pythoncapi.py `` requires Python 3.6 or newer.
14
+
15
+ See the `documentation at ReadTheDocs
16
+ <https://pythoncapi-compat.readthedocs.io/en/latest/> `_
17
+ for more details.
18
+
19
+ Getting started
20
+ ===============
21
+
22
+ To upgrade a specific file::
23
+
24
+ python3 upgrade_pythoncapi.py module.c
25
+
26
+ To upgrade all C/C++ files in a directory::
27
+
28
+ python3 upgrade_pythoncapi.py src/
29
+
30
+ Select operations
31
+ -----------------
32
+
33
+ To only replace ``op->ob_type `` with ``Py_TYPE(op) ``, select the ``Py_TYPE ``
34
+ operation with::
35
+
36
+ python3 upgrade_pythoncapi.py -o Py_TYPE module.c
37
+
38
+ Or the opposite, to apply all operations but leave ``op->ob_type `` unchanged,
39
+ deselect the ``Py_TYPE `` operation with::
40
+
41
+ python3 upgrade_pythoncapi.py -o all,-Py_TYPE module.c
42
+
43
+ Download pythoncapi_compat.h
44
+ ----------------------------
45
+
46
+ If you want to ``pythoncapi_compat.h `` to your code base, use the
47
+ ``upgrade_pythoncapi.py `` tool to fetch it::
48
+
49
+ python3 upgrade_pythoncapi.py --download PATH
50
+
17
51
18
52
This project is distributed under the `Zero Clause BSD (0BSD) license
19
53
<https://opensource.org/licenses/0BSD> `_ and is covered by the `PSF Code of
0 commit comments