Skip to content
New issue

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

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

Already on GitHub? # to your account

specifications: add build-details.json (PEP 739) #1807

Merged
merged 8 commits into from
Apr 2, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
source/guides/github-actions-ci-cd-sample/* @webknjaz
source/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows.rst @webknjaz

# build-details.json
source/specifications/build-details/ @FFY00
source/specifications/specs/build-details-*.json @FFY00
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ sphinx-autobuild==2021.3.14
sphinx-inline-tabs==2023.4.21
sphinx-copybutton==0.5.2
sphinx-toolbox==3.5.0
sphinx-jsonschema==1.19.1
6 changes: 6 additions & 0 deletions source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"sphinx_inline_tabs",
"sphinx_copybutton",
"sphinx_toolbox.collapse",
"sphinx-jsonschema",
]

nitpicky = True
Expand Down Expand Up @@ -82,6 +83,10 @@
# https://plausible.io/packaging.python.org
html_js_files.extend(_metrics_js_files)

html_extra_path = [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed? I don't think it works the way you assume...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, sorry!

"specifications/schemas",
]

# -- Options for HTML help output ------------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-help-output

Expand Down Expand Up @@ -128,6 +133,7 @@

linkcheck_ignore = [
"http://localhost:\\d+",
"https://packaging.python.org/en/latest/specifications/schemas/.*",
"https://test.pypi.org/project/example-package-YOUR-USERNAME-HERE",
"https://pypi.org/manage/*",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I worked out why these trailing globs seem to work: linkcheck_ignore does a prefix match on the given regexes, so finishing with /* (zero-or-more trailing slashes) is essentially identical to omitting that part of the pattern.

To force a whole string match instead of a prefix match you have to specifically terminate the pattern with $

"https://test.pypi.org/manage/*",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"schema_version": "1.0",
"base_prefix": "/usr",
"base_interpreter": "/usr/bin/python",
"platform": "linux-x86_64",
"language": {
"version": "3.14",
"version_info": {
"major": 3,
"minor": 14,
"micro": 0,
"releaselevel": "alpha",
"serial": 0
}
},
"implementation": {
"name": "cpython",
"version": {
"major": 3,
"minor": 14,
"micro": 0,
"releaselevel": "alpha",
"serial": 0
},
"hexversion": 51249312,
"cache_tag": "cpython-314",
"_multiarch": "x86_64-linux-gnu"
},
"abi": {
"flags": ["t", "d"],
"extension_suffix": ".cpython-314-x86_64-linux-gnu.so",
"stable_abi_suffix": ".abi3.so"
},
"suffixes": {
"source": [".py"],
"bytecode": [".pyc"],
"optimized_bytecode": [".pyc"],
"debug_bytecode": [".pyc"],
"extensions": [".cpython-314-x86_64-linux-gnu.so", ".abi3.so", ".so"]
},
"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_extensions": true
},
"c_api": {
"headers": "/usr/include/python3.14",
"pkgconfig_path": "/usr/lib/pkgconfig"
}
}
52 changes: 52 additions & 0 deletions source/specifications/build-details/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
.. _build-details:

==========================
:file:`build-details.json`
==========================

.. toctree::
:hidden:

v1.0 <v1.0>


The ``build-details.json`` file is a standardized file format that provides
build-specfic information of a Python installation, such as its version,
extension ABI details, and other information that is specific to that particular
build of Python.

Starting from Python 3.14, a ``build-details.json`` file is installed in the
platform-independent standard library directory (``stdlib``, e.g.
``/usr/lib/python3.14/build-details.json``).

Please refer to the :ref:`latest version <build-details-v1.0>` for its
specification.

..
Update to point to the latest version!

.. literalinclude:: examples/build-details-v1.0.json
:caption: Example
:language: json
:linenos:


Changelog
---------

..
Order in decreasing order.

v1.0
~~~~

.. list-table::

* - Specification
- :ref:`build-details-v1.0`

* - Schema
- :download:`https://packaging.python.org/en/latest/specifications/schemas/build-details-v1.0.schema.json <../schemas/build-details-v1.0.schema.json>`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the actual generated href isn't preserved, as :download: copies things into another location.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, thanks for noticing, we should go back to a normal link then.



- Initial version, introduced by :pep:`739`.
18 changes: 18 additions & 0 deletions source/specifications/build-details/v1.0.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.. _build-details-v1.0:

===========================
``build-details.json`` v1.0
===========================


Specification
-------------

.. jsonschema:: ../schemas/build-details-v1.0.schema.json
:lift_title: false


Example
-------

.. literalinclude:: examples/build-details-v1.0.json
1 change: 1 addition & 0 deletions source/specifications/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ and for proposing new ones, is documented on
section-installation-metadata
section-distribution-formats
section-package-indices
section-python-description-formats
Loading