File tree Expand file tree Collapse file tree 4 files changed +169
-171
lines changed
Expand file tree Collapse file tree 4 files changed +169
-171
lines changed Original file line number Diff line number Diff line change 1- name : Update stable_abi.txt
1+ name : Update stable_abi.toml
22
33on :
44 workflow_dispatch :
88
99jobs :
1010 update :
11- name : Update stable_abi.txt
11+ name : Update stable_abi.toml
1212 runs-on : ubuntu-latest
1313 steps :
1414 - uses : actions/checkout@v3
15- - name : Fetch latest stable_abi.txt
15+ - name : Fetch latest stable_abi.toml
1616 run : |
17- curl https://raw.githubusercontent.com/python/cpython/main/Misc/stable_abi.txt > stable_abi.txt
18- - name : Parse stable_abi.txt to produce python3.def
17+ curl https://raw.githubusercontent.com/python/cpython/main/Misc/stable_abi.toml > stable_abi.toml
18+ - name : Install Python TOML parser
1919 run : |
20- ./parse-stable-abi.py < stable_abi.txt > src/python3.def
20+ sudo apt-get install --yes python3-pip
21+ pip install tomli
22+ - name : Parse stable_abi.toml to produce python3.def
23+ run : |
24+ ./parse-stable-abi.py < stable_abi.toml > src/python3.def
2125 - name : Create Pull Request
2226 uses : peter-evans/create-pull-request@v4
2327 with :
2428 delete-branch : true
2529 add-paths : |
2630 src/python3.def
27- title : ' Update python3.def using stable_abi.txt from the latest main'
28- commit-message : ' chore: Update python3.def using stable_abi.txt from the latest main'
29- body : ' Source: https://raw.githubusercontent.com/python/cpython/main/Misc/stable_abi.txt '
31+ title : ' Update python3.def using stable_abi.toml from the latest main'
32+ commit-message : ' chore: Update python3.def using stable_abi.toml from the latest main'
33+ body : ' Source: https://raw.githubusercontent.com/python/cpython/main/Misc/stable_abi.toml '
Original file line number Diff line number Diff line change @@ -75,12 +75,11 @@ PYO3_CROSS_LIB_DIR=target/python3-dll cargo build --target x86_64-pc-windows-gnu
7575Maintenance
7676-----------
7777
78- This crate embeds the ` stable_abi.txt ` definitions file from CPython
79- in the ` Misc ` subdirectory.
78+ This crate embeds Module-Defitions based on the ` stable_abi.toml ` file from CPython.
8079
8180The upstream version of this file is located in the [ CPython project] [ cpython ]
82- repository under the same path.
81+ repository under the path ` Misc/stable_abi.toml ` .
8382This file should be updated for every subsequent CPython release
8483(e.g. for CPython 3.12).
8584
86- [ cpython ] : https://github.com/python/cpython/blob/main/Misc/stable_abi.txt
85+ [ cpython ] : https://github.com/python/cpython/blob/main/Misc/stable_abi.toml
Original file line number Diff line number Diff line change 11#!/usr/bin/env python3
2- # Parses Python Stable ABI symbol definitions from the manifest in the CPython repository located at https://github.com/python/cpython/blob/main/Misc/stable_abi.txt
2+ # Parses Python Stable ABI symbol definitions from the manifest in the CPython repository located at https://github.com/python/cpython/blob/main/Misc/stable_abi.toml
33# and produces a definition file following the format described at https://docs.microsoft.com/en-us/cpp/build/reference/module-definition-dot-def-files.
44import sys
5+ import tomli
6+
7+ stable_abi = tomli .load (sys .stdin .buffer )
58
69print ("LIBRARY python3.dll" )
710print ("EXPORTS" )
811
912count = 0
1013
11- for line in sys .stdin :
12- if line .startswith ("function" ):
13- is_data = False
14- elif line .startswith ("data" ):
15- is_data = True
16- else :
17- continue
18-
14+ for function in stable_abi ["function" ].keys ():
15+ print (function )
1916 count += 1
20- name = line .split ()[1 ]
2117
22- if is_data :
23- print (f"{ name } DATA" )
24- else :
25- print (name )
18+ for data in stable_abi ["data" ].keys ():
19+ print (f"{ data } DATA" )
20+ count += 1
2621
27- assert count >= 859
22+ assert count >= 861
You can’t perform that action at this time.
0 commit comments