Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PEP 739: add language.version_info and libpython.dynamic_stableabi #4100

Merged
merged 5 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions peps/pep-0739.rst
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,82 @@ below, which is rendered in an human-readable format here.
* - Required
- **True**

``language.version_info``
~~~~~~~~~~~~~~~~~~~~~~~~~

.. list-table::
:widths: 25 75

* - Type
- ``object``
* - Description
- Object in the format of :py:data:`sys.version_info`.

This section SHOULD be equivalent to
:py:data:`sys.version_info`.
* - Examples
- - ``{'major': 3, 'minor': 14, 'micro': 1, 'releaselevel': 'final', 'serial': 0}``
- etc.
* - Required
- **False**
* - Additional properties
- **Not allowed**

``language.version_info.major``
+++++++++++++++++++++++++++++++

.. list-table::
:widths: 25 75

* - Type
- ``number``
* - Required
- **True**

``language.version_info.minor``
+++++++++++++++++++++++++++++++

.. list-table::
:widths: 25 75

* - Type
- ``number``
* - Required
- **True**

``language.version_info.micro``
+++++++++++++++++++++++++++++++

.. list-table::
:widths: 25 75

* - Type
- ``number``
* - Required
- **True**

``language.version_info.releaselevel``
++++++++++++++++++++++++++++++++++++++

.. list-table::
:widths: 25 75

* - Type
- ``string`` (enum — ``alpha``, ``beta``, ``candidate``, ``final``)
* - Required
- **True**

``language.version_info.serial``
++++++++++++++++++++++++++++++++

.. list-table::
:widths: 25 75

* - Type
- ``number``
* - Required
- **True**

``implementation``
------------------

Expand Down Expand Up @@ -463,6 +539,29 @@ below, which is rendered in an human-readable format here.
* - Required
- **False**

``libpython.dynamic_stableabi``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. list-table::
:widths: 25 75

* - Type
- ``string``
* - 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.

This field MUST be present if the Python installation provides a
dynamic ``libpython`` library, otherwise this entry will be
missing.
* - Examples
- - ``/usr/lib/libpython3.so``
- ``lib/libpython3.so``
- etc.
* - Required
- **False**

``libpython.static``
~~~~~~~~~~~~~~~~~~~~

Expand Down
10 changes: 9 additions & 1 deletion peps/pep-0739/example.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
"base_prefix": "/usr",
"platform": "linux-x86_64",
"language": {
"version": "3.14"
"version": "3.14",
"version_info": {
"major": 3,
"minor": 14,
"micro": 0,
"releaselevel": "alpha",
"serial": 0
},
FFY00 marked this conversation as resolved.
Show resolved Hide resolved
},
"implementation": {
"name": "cpython",
Expand Down Expand Up @@ -35,6 +42,7 @@
},
"libpython": {
"dynamic": "/usr/lib/libpython3.14.so.1.0",
"dynamic_stableabi": "/usr/lib/libpython3.so",
"static": "/usr/lib/python3.14/config-3.14-x86_64-linux-gnu/libpython3.14.a",
"link_to_libpython": true
},
Expand Down
43 changes: 42 additions & 1 deletion peps/pep-0739/python-build-info-v1.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,39 @@
"type": "string",
"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()``.",
"examples": ["3.14"]
},
"version_info": {
"type": "object",
"description": "Object in the format of :py:data:`sys.version_info`.\n\nThis section SHOULD be equivalent to :py:data:`sys.version_info`.",
"required": ["major", "minor", "micro", "releaselevel", "serial"],
"additionalProperties": false,
"examples": [
{
"major": 3,
"minor": 14,
"micro": 1,
"releaselevel": "final",
"serial": 0
}
],
"properties": {
"major": {
"type": "number"
},
"minor": {
"type": "number"
},
"micro": {
"type": "number"
},
"releaselevel": {
"type": "string",
"enum": ["alpha", "beta", "candidate", "final"]
},
"serial": {
"type": "number"
}
}
}
}
},
Expand Down Expand Up @@ -70,7 +103,7 @@
"examples": [
{
"major": 3,
"minor": 13,
"minor": 14,
"micro": 1,
"releaselevel": "final",
"serial": 0
Expand Down Expand Up @@ -181,6 +214,14 @@
"lib/libpython3.14.so.1.0"
]
},
"dynamic_stableabi": {
"type": "string",
"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.",
"examples": [
"/usr/lib/libpython3.so",
"lib/libpython3.so"
]
},
"static": {
"type": "string",
"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.",
Expand Down
Loading