From 80da0c7340f3818613d1a907f69ba3131e14b15e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Tue, 19 Dec 2023 15:19:28 +0000 Subject: [PATCH 01/13] PEP 9999: add static description file for Python installations PEP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe Laíns --- peps/pep-9999.rst | 126 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 peps/pep-9999.rst diff --git a/peps/pep-9999.rst b/peps/pep-9999.rst new file mode 100644 index 00000000000..7a017b9a025 --- /dev/null +++ b/peps/pep-9999.rst @@ -0,0 +1,126 @@ +PEP: 9999 +Title: Static description file for Python installations +Author: Filipe Laíns +PEP-Delegate: +Status: Draft +Type: Informational +Content-Type: text/x-rst +Created: 01-Oct-2023 +Python-Version: 3.13 +Resolution: + + +Abstract +======== + +Introduce a standard format for a static description file to describe Python +installations. + + +Rationale +========= + +When introspecting a Python installation, running code is often undesirable or +impossible. Having a static description file makes various of Python +installation details available without having to run the interpreter. + +This is helpful for use-cases such as cross-compilation, Python launchers, etc. + + +Scope +===== + +This PEP only defines a standard format for a file describing Python +installations, distributing such files is out of scope. + +Python implementations may choose to include a self-describing file as part of +their distribution, but they are not required to, and it out of scope for this +PEP to define how that may happen, if they decide to do so. + + +Specification +============= + +The standard Python installation description format consists of the JSON +representation of a dictionary with the with the following keys. + +``schema_version`` +------------------ + +:Type: ``number`` +:Description: Version of the schema to parse the file contents. It should be + ``1`` for the format described in this document. Future versions + may add, remove, or change fields. + +``language`` +------------ + +Subsection with details related to the language specification. + +``version`` +~~~~~~~~~~~ + +:Type: ``string`` +:Description: String representation the Python language version. Same as the + ``PY_VERSION`` macro on CPython. + +``version_parts`` +~~~~~~~~~~~~~~~~~ + +:Type: ``object`` +:Description: Equivalent to :py:data:`sys.version_info`. + +``implementation`` +------------------ + +Subsection with details related to Python implementation. Usually, this section +should be roghly equivalent to :py:data:`sys.implementation`. + +``name`` +~~~~~~~~ + +:Type: ``string`` +:Description: Lower-case name of the Python implementation. + +Implementation-specific keys +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Additionally to the keys defined above, implementations may choose to include +extra keys with extra implementation-specific details. + +``c_api`` +--------- + +Subsection with details related to the Python C API, if available. If the Python +implementation does not provide a C API, this section will be missing. + +TODO + + +Example +======= + + +.. code-block:: json + + { + "schema_version": 1, + "language": { + "version": "3.13.1", + "version_parts": { + "major": 3, + "minor": 13, + "micro": 1, + "releaselevel": "final", + "serial": 0 + } + }, + "implementation": { + "name": "cpython", + "hexversion": "...", + "cache_tag": "cpython-313", + "multiarch": "x86_64-linux-gnu" + }, + "c_api": { + } + } From 10ba50fbfe2a267482e9e7209c1844095f7e453b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Tue, 19 Dec 2023 15:32:57 +0000 Subject: [PATCH 02/13] fix metadata MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe Laíns --- peps/pep-9999.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/peps/pep-9999.rst b/peps/pep-9999.rst index 7a017b9a025..51283599cb8 100644 --- a/peps/pep-9999.rst +++ b/peps/pep-9999.rst @@ -5,9 +5,8 @@ PEP-Delegate: Status: Draft Type: Informational Content-Type: text/x-rst -Created: 01-Oct-2023 +Created: 19-Dec-2023 Python-Version: 3.13 -Resolution: Abstract From 3d65f95d1d003c79d8bd024c2f2cf4dfd02f148b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Tue, 19 Dec 2023 15:33:52 +0000 Subject: [PATCH 03/13] use PEP number 739 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe Laíns --- peps/{pep-9999.rst => pep-0739.rst} | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) rename peps/{pep-9999.rst => pep-0739.rst} (98%) diff --git a/peps/pep-9999.rst b/peps/pep-0739.rst similarity index 98% rename from peps/pep-9999.rst rename to peps/pep-0739.rst index 51283599cb8..8aece245183 100644 --- a/peps/pep-9999.rst +++ b/peps/pep-0739.rst @@ -1,10 +1,8 @@ -PEP: 9999 +PEP: 739 Title: Static description file for Python installations Author: Filipe Laíns -PEP-Delegate: Status: Draft Type: Informational -Content-Type: text/x-rst Created: 19-Dec-2023 Python-Version: 3.13 From 62aae6af56c2575391f7ce1ee5c3e90702c53664 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Tue, 19 Dec 2023 17:51:27 +0000 Subject: [PATCH 04/13] address review comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe Laíns --- peps/pep-0739.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/peps/pep-0739.rst b/peps/pep-0739.rst index 8aece245183..98f59a34471 100644 --- a/peps/pep-0739.rst +++ b/peps/pep-0739.rst @@ -31,8 +31,8 @@ This PEP only defines a standard format for a file describing Python installations, distributing such files is out of scope. Python implementations may choose to include a self-describing file as part of -their distribution, but they are not required to, and it out of scope for this -PEP to define how that may happen, if they decide to do so. +their distribution, but they are not required to, and it is out of scope for +this PEP to define how that may happen, if they decide to do so. Specification @@ -71,7 +71,8 @@ Subsection with details related to the language specification. ------------------ Subsection with details related to Python implementation. Usually, this section -should be roghly equivalent to :py:data:`sys.implementation`. +is implementation-defined, but it is recommended to make it roughly equivalent +to :py:data:`sys.implementation`. ``name`` ~~~~~~~~ From 6dc73694ef2c8be85cec987805b1fac4bb9c6975 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Tue, 19 Dec 2023 17:57:03 +0000 Subject: [PATCH 05/13] remove Python-Version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe Laíns --- peps/pep-0739.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/peps/pep-0739.rst b/peps/pep-0739.rst index 98f59a34471..d41dd8d03d2 100644 --- a/peps/pep-0739.rst +++ b/peps/pep-0739.rst @@ -4,7 +4,6 @@ Author: Filipe Laíns Status: Draft Type: Informational Created: 19-Dec-2023 -Python-Version: 3.13 Abstract From 2c511779a2aaf197e787cb989b23652ead9eb04f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Fri, 29 Dec 2023 16:08:12 +0000 Subject: [PATCH 06/13] clarify the spec for the "implementation" section MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe Laíns --- peps/pep-0739.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/peps/pep-0739.rst b/peps/pep-0739.rst index d41dd8d03d2..8f8a8e74b7d 100644 --- a/peps/pep-0739.rst +++ b/peps/pep-0739.rst @@ -69,9 +69,9 @@ Subsection with details related to the language specification. ``implementation`` ------------------ -Subsection with details related to Python implementation. Usually, this section -is implementation-defined, but it is recommended to make it roughly equivalent -to :py:data:`sys.implementation`. +Subsection with details related to Python implementation. While only the +``name`` key is required in this section, it SHOULD be equivalent to +:py:data:`sys.implementation` on most implementations. ``name`` ~~~~~~~~ From 5fd9f475b64f5b9b9c8929589ca42fcb5a169ed2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Fri, 29 Dec 2023 16:13:26 +0000 Subject: [PATCH 07/13] clarify "implementation" spec MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe Laíns --- peps/pep-0739.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/peps/pep-0739.rst b/peps/pep-0739.rst index 8f8a8e74b7d..755758f70f3 100644 --- a/peps/pep-0739.rst +++ b/peps/pep-0739.rst @@ -70,7 +70,7 @@ Subsection with details related to the language specification. ------------------ Subsection with details related to Python implementation. While only the -``name`` key is required in this section, it SHOULD be equivalent to +``name`` key is required in this section, this section SHOULD be equivalent to :py:data:`sys.implementation` on most implementations. ``name`` From f3441e565f90ef7b2c9f4d64cdfd83429ab47e44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Fri, 29 Dec 2023 16:14:59 +0000 Subject: [PATCH 08/13] add "libpython" section MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe Laíns --- peps/pep-0739.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/peps/pep-0739.rst b/peps/pep-0739.rst index 755758f70f3..0848075a817 100644 --- a/peps/pep-0739.rst +++ b/peps/pep-0739.rst @@ -93,6 +93,14 @@ implementation does not provide a C API, this section will be missing. TODO +``libpython`` +------------- + +Subsection with details related to the ``libpython``, if available. If the +Python implementation does not provide a ``libpython`` library, this section +will be missing. + +TODO Example ======= From e13913fd034b90d5900648f597ff973a4c62f21e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Fri, 29 Dec 2023 16:49:05 +0000 Subject: [PATCH 09/13] change type to Standards Track MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe Laíns --- peps/pep-0739.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/peps/pep-0739.rst b/peps/pep-0739.rst index 0848075a817..adbe77c3557 100644 --- a/peps/pep-0739.rst +++ b/peps/pep-0739.rst @@ -2,7 +2,7 @@ PEP: 739 Title: Static description file for Python installations Author: Filipe Laíns Status: Draft -Type: Informational +Type: Standards Track Created: 19-Dec-2023 From 6c7c90caab8a58bcdadf44705e4e4baa02d5148a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Fri, 29 Dec 2023 16:49:20 +0000 Subject: [PATCH 10/13] set topic to Packaging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe Laíns --- peps/pep-0739.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/peps/pep-0739.rst b/peps/pep-0739.rst index adbe77c3557..7152cf6ac3c 100644 --- a/peps/pep-0739.rst +++ b/peps/pep-0739.rst @@ -3,6 +3,7 @@ Title: Static description file for Python installations Author: Filipe Laíns Status: Draft Type: Standards Track +Topic: Packaging Created: 19-Dec-2023 From 568826b4cb8f96b5e1f3cb08993d121fc007d88c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Fri, 29 Dec 2023 18:03:07 +0000 Subject: [PATCH 11/13] add PEP-Delegate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe Laíns --- peps/pep-0739.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/peps/pep-0739.rst b/peps/pep-0739.rst index 7152cf6ac3c..2c0310f2bc6 100644 --- a/peps/pep-0739.rst +++ b/peps/pep-0739.rst @@ -1,6 +1,7 @@ PEP: 739 Title: Static description file for Python installations Author: Filipe Laíns +PEP-Delegate: Paul Moore Status: Draft Type: Standards Track Topic: Packaging From fc9b3538ac8bb769a21504ffd655c7d3f65b3b45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Sat, 20 Jan 2024 22:28:17 +0000 Subject: [PATCH 12/13] PEP 739: add copyright section MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe Laíns --- peps/pep-0739.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/peps/pep-0739.rst b/peps/pep-0739.rst index 2c0310f2bc6..b80ed8f183f 100644 --- a/peps/pep-0739.rst +++ b/peps/pep-0739.rst @@ -131,3 +131,9 @@ Example "c_api": { } } + +Copyright +========= + +This document is placed in the public domain or under the +CC0-1.0-Universal license, whichever is more permissive. From d37739dac77a6f8b6c1179445616adda6ac01892 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Sat, 20 Jan 2024 22:30:22 +0000 Subject: [PATCH 13/13] PEP 739: add Python-Version header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe Laíns --- peps/pep-0739.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/peps/pep-0739.rst b/peps/pep-0739.rst index b80ed8f183f..67871b70b75 100644 --- a/peps/pep-0739.rst +++ b/peps/pep-0739.rst @@ -6,6 +6,7 @@ Status: Draft Type: Standards Track Topic: Packaging Created: 19-Dec-2023 +Python-Version: 3.13 Abstract