Skip to content

Commit 2682b1e

Browse files
authored
Remove upgrade_pythoncapi.py script (#198)
1 parent f1fb61f commit 2682b1e

7 files changed

Lines changed: 3 additions & 1935 deletions

File tree

‎README.rst‎

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -8,48 +8,12 @@ Python C API compatibility
88

99
The ``pythoncapi-compat`` project can be used to write a C or C++ extension
1010
supporting a wide range of Python versions with a single code base. It is made
11-
of the ``pythoncapi_compat.h`` header file and the ``upgrade_pythoncapi.py``
12-
script.
13-
14-
``upgrade_pythoncapi.py`` requires Python 3.6 or newer.
11+
of the ``pythoncapi_compat.h`` header file.
1512

1613
See the `documentation at ReadTheDocs
1714
<https://pythoncapi-compat.readthedocs.io/en/latest/>`_
1815
for more details.
1916

20-
Getting started
21-
===============
22-
23-
To upgrade a specific file::
24-
25-
python3 upgrade_pythoncapi.py module.c
26-
27-
To upgrade all C/C++ files in a directory::
28-
29-
python3 upgrade_pythoncapi.py src/
30-
31-
Select operations
32-
-----------------
33-
34-
To only replace ``op->ob_type`` with ``Py_TYPE(op)``, select the ``Py_TYPE``
35-
operation with::
36-
37-
python3 upgrade_pythoncapi.py -o Py_TYPE module.c
38-
39-
Or the opposite, to apply all operations but leave ``op->ob_type`` unchanged,
40-
deselect the ``Py_TYPE`` operation with::
41-
42-
python3 upgrade_pythoncapi.py -o all,-Py_TYPE module.c
43-
44-
Download pythoncapi_compat.h
45-
----------------------------
46-
47-
If you want to ``pythoncapi_compat.h`` to your code base, use the
48-
``upgrade_pythoncapi.py`` tool to fetch it::
49-
50-
python3 upgrade_pythoncapi.py --download PATH
51-
52-
5317
This project is distributed under the `Zero Clause BSD (0BSD) license
5418
<https://opensource.org/licenses/0BSD>`_ and is covered by the `PSF Code of
5519
Conduct <https://www.python.org/psf/codeofconduct/>`_.

‎docs/changelog.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Changelog
22
=========
33

4+
* 2026-10-11: Remove the ``upgrade_pythoncapi.py`` script.
45
* 2026-10-10: Add ``PyObject_GenericHash()`` and
56
``PyUnicodeWriter_WriteUCS4()`` functions. runtests.py now runs tests in
67
parallel.

‎docs/index.rst‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ Python C API compatibility
44

55
The ``pythoncapi-compat`` project can be used to write a C or C++ extension
66
supporting a wide range of Python versions with a single code base. It is made
7-
of the ``pythoncapi_compat.h`` header file and the ``upgrade_pythoncapi.py``
8-
script.
7+
of the ``pythoncapi_compat.h`` header file.
98

109
* Homepage: `GitHub pythoncapi-compat project
1110
<https://github.com/python/pythoncapi-compat>`_.
@@ -18,7 +17,6 @@ Documentation:
1817
:maxdepth: 2
1918

2019
api
21-
upgrade
2220
users
2321
tests
2422
changelog

‎docs/upgrade.rst‎

Lines changed: 0 additions & 168 deletions
This file was deleted.

‎runtests.py‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
TEST_DIR = os.path.join(os.path.dirname(__file__), 'tests')
2222
TEST_COMPAT = os.path.join(TEST_DIR, "test_pythoncapi_compat.py")
23-
TEST_UPGRADE = os.path.join(TEST_DIR, "test_upgrade_pythoncapi.py")
2423

2524
PYTHONS = (
2625
# CPython
@@ -123,16 +122,6 @@ def worker(executable):
123122
print(f"Tested: {len(jobs)} Python executables")
124123

125124

126-
def test_upgrade_pythoncapi(args):
127-
# upgrade_pythoncapi.py requires Python 3.6 or newer
128-
print(f"Run {TEST_UPGRADE}")
129-
cmd = [sys.executable, "-u", TEST_UPGRADE]
130-
if args.verbose:
131-
cmd.append('-v')
132-
run_command(cmd)
133-
print()
134-
135-
136125
def test_current_version(args):
137126
with tempfile.TemporaryDirectory() as build_dir:
138127
cmd = get_test_command(sys.executable, args.verbose, build_dir)
@@ -144,8 +133,6 @@ def main():
144133
start_time = time.perf_counter()
145134
args = parse_args()
146135

147-
test_upgrade_pythoncapi(args)
148-
149136
if not args.current:
150137
run_tests_parallel(args)
151138
else:

0 commit comments

Comments
 (0)