Skip to content

Commit d24411f

Browse files
authored
PEP 739: add language.version_info and libpython.dynamic_stableabi
1 parent cb6e37c commit d24411f

File tree

3 files changed

+151
-3
lines changed

3 files changed

+151
-3
lines changed

peps/pep-0739.rst

Lines changed: 100 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,82 @@ below, which is rendered in an human-readable format here.
174174
* - Required
175175
- **True**
176176

177+
``language.version_info``
178+
~~~~~~~~~~~~~~~~~~~~~~~~~
179+
180+
.. list-table::
181+
:widths: 25 75
182+
183+
* - Type
184+
- ``object``
185+
* - Description
186+
- Object in the format of :py:data:`sys.version_info`.
187+
188+
This section SHOULD be equivalent to
189+
:py:data:`sys.version_info`.
190+
* - Examples
191+
- - ``{'major': 3, 'minor': 14, 'micro': 1, 'releaselevel': 'final', 'serial': 0}``
192+
- etc.
193+
* - Required
194+
- **False**
195+
* - Additional properties
196+
- **Not allowed**
197+
198+
``language.version_info.major``
199+
+++++++++++++++++++++++++++++++
200+
201+
.. list-table::
202+
:widths: 25 75
203+
204+
* - Type
205+
- ``number``
206+
* - Required
207+
- **True**
208+
209+
``language.version_info.minor``
210+
+++++++++++++++++++++++++++++++
211+
212+
.. list-table::
213+
:widths: 25 75
214+
215+
* - Type
216+
- ``number``
217+
* - Required
218+
- **True**
219+
220+
``language.version_info.micro``
221+
+++++++++++++++++++++++++++++++
222+
223+
.. list-table::
224+
:widths: 25 75
225+
226+
* - Type
227+
- ``number``
228+
* - Required
229+
- **True**
230+
231+
``language.version_info.releaselevel``
232+
++++++++++++++++++++++++++++++++++++++
233+
234+
.. list-table::
235+
:widths: 25 75
236+
237+
* - Type
238+
- ``string`` (enum — ``alpha``, ``beta``, ``candidate``, ``final``)
239+
* - Required
240+
- **True**
241+
242+
``language.version_info.serial``
243+
++++++++++++++++++++++++++++++++
244+
245+
.. list-table::
246+
:widths: 25 75
247+
248+
* - Type
249+
- ``number``
250+
* - Required
251+
- **True**
252+
177253
``implementation``
178254
------------------
179255

@@ -222,7 +298,7 @@ below, which is rendered in an human-readable format here.
222298
- Object in the format of :py:data:`sys.version_info`, containing
223299
the implementation version.
224300
* - Examples
225-
- - ``{'major': 3, 'minor': 13, 'micro': 1, 'releaselevel': 'final', 'serial': 0}``
301+
- - ``{'major': 3, 'minor': 14, 'micro': 1, 'releaselevel': 'final', 'serial': 0}``
226302
- ``{'major': 7, 'minor': 3, 'micro': 16, 'releaselevel': 'final', 'serial': 0}``
227303
- etc.
228304
* - Required
@@ -463,6 +539,29 @@ below, which is rendered in an human-readable format here.
463539
* - Required
464540
- **False**
465541

542+
``libpython.dynamic_stableabi``
543+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
544+
545+
.. list-table::
546+
:widths: 25 75
547+
548+
* - Type
549+
- ``string``
550+
* - Description
551+
- The path to the dynamic ``libpython`` library for the stable
552+
ABI. Either an absolute path, or a relative path to the path
553+
defined in the ``base_prefix`` key.
554+
555+
This field MUST be present if the Python installation provides a
556+
dynamic ``libpython`` library, otherwise this entry will be
557+
missing.
558+
* - Examples
559+
- - ``/usr/lib/libpython3.so``
560+
- ``lib/libpython3.so``
561+
- etc.
562+
* - Required
563+
- **False**
564+
466565
``libpython.static``
467566
~~~~~~~~~~~~~~~~~~~~
468567

peps/pep-0739/example.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@
33
"base_prefix": "/usr",
44
"platform": "linux-x86_64",
55
"language": {
6-
"version": "3.14"
6+
"version": "3.14",
7+
"version_info": {
8+
"major": 3,
9+
"minor": 14,
10+
"micro": 0,
11+
"releaselevel": "alpha",
12+
"serial": 0
13+
}
714
},
815
"implementation": {
916
"name": "cpython",
@@ -35,6 +42,7 @@
3542
},
3643
"libpython": {
3744
"dynamic": "/usr/lib/libpython3.14.so.1.0",
45+
"dynamic_stableabi": "/usr/lib/libpython3.so",
3846
"static": "/usr/lib/python3.14/config-3.14-x86_64-linux-gnu/libpython3.14.a",
3947
"link_to_libpython": true
4048
},

peps/pep-0739/python-build-info-v1.schema.json

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,39 @@
4343
"type": "string",
4444
"description": "String representation the Python language version — a version string consisting only of the *major* and *minor* components.\n\nThis field SHOULD be equivalent to ``sysconfig.get_python_version()``.",
4545
"examples": ["3.14"]
46+
},
47+
"version_info": {
48+
"type": "object",
49+
"description": "Object in the format of :py:data:`sys.version_info`.\n\nThis section SHOULD be equivalent to :py:data:`sys.version_info`.",
50+
"required": ["major", "minor", "micro", "releaselevel", "serial"],
51+
"additionalProperties": false,
52+
"examples": [
53+
{
54+
"major": 3,
55+
"minor": 14,
56+
"micro": 1,
57+
"releaselevel": "final",
58+
"serial": 0
59+
}
60+
],
61+
"properties": {
62+
"major": {
63+
"type": "number"
64+
},
65+
"minor": {
66+
"type": "number"
67+
},
68+
"micro": {
69+
"type": "number"
70+
},
71+
"releaselevel": {
72+
"type": "string",
73+
"enum": ["alpha", "beta", "candidate", "final"]
74+
},
75+
"serial": {
76+
"type": "number"
77+
}
78+
}
4679
}
4780
}
4881
},
@@ -70,7 +103,7 @@
70103
"examples": [
71104
{
72105
"major": 3,
73-
"minor": 13,
106+
"minor": 14,
74107
"micro": 1,
75108
"releaselevel": "final",
76109
"serial": 0
@@ -181,6 +214,14 @@
181214
"lib/libpython3.14.so.1.0"
182215
]
183216
},
217+
"dynamic_stableabi": {
218+
"type": "string",
219+
"description": "The path to the dynamic ``libpython`` library for the stable ABI. Either an absolute path, or a relative path to the path defined in the ``base_prefix`` key.\n\nThis field MUST be present if the Python installation provides a dynamic ``libpython`` library, otherwise this entry will be missing.",
220+
"examples": [
221+
"/usr/lib/libpython3.so",
222+
"lib/libpython3.so"
223+
]
224+
},
184225
"static": {
185226
"type": "string",
186227
"description": "The path to the static ``libpython`` library. Either an absolute path, or a relative path to the path defined in the ``base_prefix`` key.\n\nThis field MUST be present if the Python installation provides a static ``libpython`` library, otherwise this entry will be missing.",

0 commit comments

Comments
 (0)