Skip to content

Commit 2a18b29

Browse files
authored
PEP 739: add version specification to schema_version (#4112)
1 parent 5c7b771 commit 2a18b29

File tree

3 files changed

+25
-10
lines changed

3 files changed

+25
-10
lines changed

peps/pep-0739.rst

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ below, which is rendered in an human-readable format here.
7474
* - ``$schema``
7575
- https://json-schema.org/draft/2020-12/schema
7676
* - ``$id``
77-
- https://github.com/python/peps/blob/main/peps/pep-0739/python-build-info-v1.schema.json
77+
- https://github.com/python/peps/blob/main/peps/pep-0739/python-build-info-v1.0.schema.json
7878
* - Title
7979
- Static description file for the build details of Python
8080
installations
@@ -90,13 +90,28 @@ below, which is rendered in an human-readable format here.
9090
:widths: 25 75
9191

9292
* - Type
93-
- ``string`` (constant — ``1``)
93+
- ``string`` (constant — ``1.0``)
9494
* - Description
9595
- Schema version.
9696

97-
This is a constant value and MUST be ``1``, when using the
98-
schema described here. Future iterations of this schema MUST
99-
update this value.
97+
This is a string following the format ``<MAJOR>.<MINOR>``, where
98+
``<MAJOR>`` and ``<MINOR>`` are unpaded numbers and represent
99+
the **major** and **minor** components of the version. Versions
100+
may be arithmetic compared by intrepreting the version string as
101+
a decimal number.
102+
103+
For this specification version, this value is constant and MUST
104+
be ``1.0``.
105+
106+
Future versions of this schema MUST use a higher version number.
107+
Future versions of this schema MUST NOT use the same **major**
108+
version component as other schema version unless its
109+
specification is deemed backwards-compatible with them — it
110+
can't change, or extend, any parts of the current specification
111+
in such a way as the semantics of the interpreted data differ,
112+
or that data valid under the new specification is invalid under
113+
the older specification, with the exception of additional
114+
properties (errors caused by ``additionalProperties``).
100115
* - Required
101116
- **True**
102117

@@ -698,7 +713,7 @@ Example
698713
JSON Schema
699714
===========
700715

701-
.. literalinclude:: pep-0739/python-build-info-v1.schema.json
716+
.. literalinclude:: pep-0739/python-build-info-v1.0.schema.json
702717
:language: json
703718
:linenos:
704719

peps/pep-0739/example.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"schema_version": "1",
2+
"schema_version": "1.0",
33
"base_prefix": "/usr",
44
"platform": "linux-x86_64",
55
"language": {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
3-
"$id": "https://github.com/python/peps/blob/main/peps/pep-0739/python-build-info-v1.schema.json",
3+
"$id": "https://github.com/python/peps/blob/main/peps/pep-0739/python-build-info-v1.0.schema.json",
44
"type": "object",
55
"title": "Static description file for the build details of Python installations",
66
"required": [
@@ -13,8 +13,8 @@
1313
"properties": {
1414
"schema_version": {
1515
"type": "string",
16-
"description": "Schema version.\n\nThis is a constant value and MUST be ``1``, when using the schema described here. Future iterations of this schema MUST update this value.",
17-
"const": "1"
16+
"description": "Schema version.\n\nThis is a string following the format ``<MAJOR>.<MINOR>``, where ``<MAJOR>`` and ``<MINOR>`` are unpaded numbers and represent the **major** and **minor** components of the version. Versions may be arithmetic compared by intrepreting the version string as a decimal number.\n\nFor this specification version, this value is constant and MUST be ``1.0``.\n\nFuture versions of this schema MUST use a higher version number. Future versions of this schema MUST NOT use the same **major** version component as other schema version unless its specification is deemed backwards-compatible with them — it can't change, or extend, any parts of the current specification in such a way as the semantics of the interpreted data differ, or that data valid under the new specification is invalid under the older specification, with the exception of additional properties (errors caused by ``additionalProperties``).",
17+
"const": "1.0"
1818
},
1919
"base_prefix": {
2020
"type": "string",

0 commit comments

Comments
 (0)