From 5317a90b67d71ceb5cbd0147d83322a105463595 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Thu, 28 Apr 2022 18:25:55 -0600 Subject: [PATCH 1/3] Add a quick-start guide to the repo README --- README.rst | 42 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 8de9210..27d0585 100644 --- a/README.rst +++ b/README.rst @@ -10,10 +10,44 @@ The ``pythoncapi-compat`` project can be used to write a C extension supporting a wide range of Python versions with a single code base. It is made of the ``pythoncapi_compat.h`` header file and the ``upgrade_pythoncapi.py`` script. -* Homepage: `GitHub pythoncapi-compat project - `_. -* `Documentation - `_ +``upgrade_pythoncapi.py`` requires Python 3.6 or newer. + +See the `documentation at RTD +`_ +for more details. + +Quick-start guide +================= + +To upgrade a specific file:: + + python3 upgrade_pythoncapi.py module.c + +To upgrade all C/C++ files in a directory:: + + python3 upgrade_pythoncapi.py src/ + +Select operations +----------------- + +To only replace ``op->ob_type`` with ``Py_TYPE(op)``, select the ``Py_TYPE`` +operation with:: + + python3 upgrade_pythoncapi.py -o Py_TYPE module.c + +Or the opposite, to apply all operations but leave ``op->ob_type`` unchanged, +deselect the ``Py_TYPE`` operation with:: + + python3 upgrade_pythoncapi.py -o all,-Py_TYPE module.c + +Download pythoncapi_compat.h +---------------------------- + +If you want to ``pythoncapi_compat.h`` to your code base, use the +``upgrade_pythoncapi.py`` tool to fetch it:: + + python3 upgrade_pythoncapi.py --download PATH + This project is distributed under the `Zero Clause BSD (0BSD) license `_ and is covered by the `PSF Code of From 4b6a94941052e4674616644cc4e9d0d7c9ea1091 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Thu, 28 Apr 2022 18:32:23 -0600 Subject: [PATCH 2/3] Rename to Getting Started --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 27d0585..ba652f7 100644 --- a/README.rst +++ b/README.rst @@ -16,8 +16,8 @@ See the `documentation at RTD `_ for more details. -Quick-start guide -================= +Getting started +=============== To upgrade a specific file:: From eb93c4f85d9d2a31467cdeb4a530647ce53a2ca7 Mon Sep 17 00:00:00 2001 From: Erlend Egeberg Aasland Date: Fri, 29 Apr 2022 09:41:12 -0600 Subject: [PATCH 3/3] Update README.rst Co-authored-by: Victor Stinner --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index ba652f7..4f3e560 100644 --- a/README.rst +++ b/README.rst @@ -12,7 +12,7 @@ a wide range of Python versions with a single code base. It is made of the ``upgrade_pythoncapi.py`` requires Python 3.6 or newer. -See the `documentation at RTD +See the `documentation at ReadTheDocs `_ for more details.