Skip to content

Commit 964c270

Browse files
committed
Make notes in metadata.toml explicit.
1 parent ec9f798 commit 964c270

File tree

3 files changed

+26
-25
lines changed

3 files changed

+26
-25
lines changed

docs/site/03-compatibility.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ img.pylogo {
6969
xhr.onload = function () {
7070
if (this.status === 200) {
7171
const patches = [];
72-
const lines = this.responseText.trim().split('\n');
72+
const lines = txt.split('\n');
7373
var currentPatch = null;
7474
for (let i = 0; i < lines.length; i++) {
7575
const line = lines[i].trim();
@@ -84,12 +84,8 @@ img.pylogo {
8484
}
8585
let pkgName = line.substring(2, line.indexOf(".")).trim();
8686
currentPatch = {name: pkgName, version: DB.ANY_VERSION};
87-
} else if (line.startsWith('#')) {
88-
if (!currentPatch.comment) {
89-
currentPatch.comment = line.substring(1).trim();
90-
} else {
91-
currentPatch.comment += ' ' + line.substring(1).trim();
92-
}
87+
} else if (line.startsWith('note =')) {
88+
currentPatch.comment = line.substring('note ='.length).trim();
9389
} else if (line.startsWith('version =')) {
9490
currentPatch.version = line.substring('version ='.length).trim().replace(/'|"/g, '').replace(/^== ?/, "").replace(/, ?/g, " and ");
9591
} else if (line.startsWith('install-priority =')) {

graalpython/lib-graalpython/patches/metadata.toml

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,16 @@ patch = 'autopep8.patch'
88
license = 'MIT'
99

1010
[[bcrypt.rules]]
11-
# With pyo3 changes upstreamed, this patch is not needed in recent versions
12-
# This old version is still used in ray's tests
11+
note = "With pyo3 changes upstreamed, this patch is not needed in recent versions. This old version is still used in ray's tests."
1312
install-priority = 0
1413
version = '== 4.0.1'
1514
patch = 'bcrypt-4.0.1.patch'
1615
license = 'Apache-2.0'
1716

1817
[[blosc2.rules]]
18+
note = "This patch is not needed in newer versions."
1919
version = '< 3'
2020
patch = 'blosc2.patch'
21-
# Not needed in newer versions
2221
install-priority = 0
2322
license = 'BSD-3-Clause'
2423

@@ -54,7 +53,7 @@ license = 'BSD-3-Clause'
5453
[[cramjam.rules]]
5554
version = '== 2.7.0'
5655
patch = 'cramjam-2.7.0.patch'
57-
# Versions since 2.10 don't need a patch
56+
note = "Versions since 2.10 don't need a patch."
5857
install-priority = 0
5958
license = 'MIT'
6059

@@ -106,6 +105,10 @@ version = '== 42.0.5'
106105
patch = 'cryptography-42.0.5.patch'
107106
license = 'Apache-2.0 OR BSD-3-Clause'
108107

108+
[[cryptography.rules]]
109+
version = '>= 43.0.0'
110+
note = "Versions newer than 43 do not need a patch."
111+
109112
[[Cython.rules]]
110113
version = '>= 3.0.10, <= 3.0.12'
111114
patch = 'Cython-3.0.10.patch'
@@ -201,7 +204,7 @@ version = '0.4.13'
201204
url = 'https://github.com/google/jax/archive/refs/tags/jaxlib-v0.4.13.tar.gz'
202205

203206
[[jiter.rules]]
204-
# Upstreamed, should not be needed in the next release
207+
note = "Our patch was accepted upstream and should not be needed in the next release."
205208
version = '<= 0.5.0'
206209
install-priority = 0
207210
patch = 'jiter.patch'
@@ -289,16 +292,16 @@ version = '>= 4.9, < 5'
289292
patch = 'lxml-4.9.patch'
290293
license = 'BSD-3-Clause'
291294

292-
# Patch already upstreamed, keeping it around for older versions
293295
[[MarkupSafe.rules]]
296+
note = "Our patch is upstreamed."
294297
version = "< 2.1.0"
295298
patch = "MarkupSafe.patch"
296299
license = "BSD-3-Clause"
297300
install-priority = 0 # Don't make pip install prefer this version
298301
dist-type = "sdist"
299302

300303
[[meson-python.rules]]
301-
# Upstreamed
304+
note = "Our patch is upstreamed."
302305
version = '<= 0.16.0'
303306
install-priority = 0
304307
patch = 'meson-python.patch'
@@ -326,6 +329,7 @@ license = 'BSD-3-Clause'
326329

327330
[[numba.rules]]
328331
# Not upstreamable, we disable the JIT
332+
note = "Numba JIT relies on bytecode parsing and is disabled on GraalPy."
329333
version = '== 0.59.1'
330334
patch = 'numba-0.59.1.patch'
331335
license = 'BSD-2-Clause'
@@ -391,11 +395,12 @@ version = '== 7.4.0'
391395
# Important: This patch esentially breaks the package, it's not upstreamable. The package relies on bytecode parsing
392396
# to do some otherwise impossible syntax shortcuts. Since it's esentially a type-checker, we just disable the overrides
393397
# checking altogether
398+
note = "This package relies on bytecode parsing and cannot work on GraalPy without significant changes. When installed on GraalPy, it is essentially disabled"
394399
patch = 'overrides-7.4.0.patch'
395400
license = 'Apache-2.0'
396401

397402
[[packaging.rules]]
398-
# Merged upstream
403+
note = "Upstream packaging now supports GraalPy."
399404
version = '< 23.2'
400405
install-priority = 0
401406
patch = 'packaging.patch'
@@ -428,7 +433,7 @@ dist-type = 'sdist'
428433
[[pendulum.rules]]
429434
version = '== 3.0.0'
430435
patch = 'pendulum-3.0.0.patch'
431-
# Not needed since 3.1
436+
note = "Not needed since 3.1."
432437
install-priority = 0
433438
license = 'MIT'
434439

@@ -510,7 +515,7 @@ patch = 'pyarrow-19.0.1.patch'
510515
license = 'Apache-2.0'
511516

512517
[[pybind11.rules]]
513-
# Upstreamed
518+
note = "This patch was accepted upstream."
514519
install-priority = 0
515520
# Note: This patch is also inlined in torch
516521
version = '>= 2.11.0, <= 2.13.6'
@@ -559,7 +564,7 @@ license = 'MIT'
559564
[[PyDriller.rules]]
560565
version = '< 2.4'
561566
patch = 'PyDriller.patch'
562-
# Upstreamed
567+
note = "Our patch was accepted upstream."
563568
install-priority = 0
564569
license = 'Apache-2.0'
565570

@@ -582,13 +587,14 @@ license = 'Apache-2.0'
582587
[[pymongo.rules]]
583588
version = ">= 4.8.0, <= 4.13.0"
584589
patch = 'pymongo-4.8.0.patch'
585-
# Upstreamed
590+
note = "Our patch was accepted upstream."
586591
install-priority = 0
587592
license = 'Apache-2.0'
588593

589594
[[PyMuPDF.rules]]
590595
version = "== 1.25.4"
591596
patch = "pymupdf.patch"
597+
note = "Building PyMuPDF needs a CPython installation besides GraalPy on the PATH."
592598
# That project is AGPL, so do not actually include *any* code of pymupdf in the patch, not even an
593599
# empty line, in the diff context. The code we write in the patch is UPL - that is compatible with
594600
# AGPL in the sense that if someone were to apply it and distribute *that*, our patch is now part
@@ -683,14 +689,14 @@ version = '2.9.1'
683689
url = 'https://github.com/ray-project/ray/archive/refs/tags/ray-2.9.1.tar.gz'
684690

685691
[[rpds_py.rules]]
686-
# Patch not needed anymore in recent version since pyo3 changes have been upstreamed
692+
note = "Our patch is not needed anymore in recent version since PyO3 now supports GraalPy."
687693
install-priority = 0
688694
version = '== 0.10.3'
689695
patch = 'rpds_py-0.10.3.patch'
690696
license = 'MIT'
691697

692698
[[safetensors.rules]]
693-
# Recent versions should use pyo3 with upstream support for graalpy
699+
note = "Our patch is not needed anymore in recent version since PyO3 now supports GraalPy."
694700
install-priority = 0
695701
version = '== 0.3.3'
696702
patch = 'safetensors-0.3.3.patch'
@@ -863,11 +869,10 @@ license = 'PSF-2.0'
863869
subdir = 'src'
864870

865871
[[urllib3.rules]]
866-
# urllib3 has a check that requires that the ssl implementation's name starts with "OpenSSL", we need to patch it out
872+
note = "urllib3 in this version range has a check that requires that the ssl implementation's name starts with 'OpenSSL', we need to patch it out. Older versions worked fine before the check was added. Newer versions turned it into a warning."
867873
patch = 'urllib3-2.patch'
868874
license = 'MIT'
869875
subdir = 'src'
870-
# Older versions worked fine before the check was added. Newer versions turned it into a warning
871876
version = '>= 2, < 2.0.3'
872877
install-priority = 0
873878

@@ -879,7 +884,7 @@ license = 'MIT'
879884
[[watchfiles.rules]]
880885
version = '== 0.21.0'
881886
patch = 'watchfiles-0.21.0.patch'
882-
# Not needed in newer versions
887+
note = "Patch is not needed anymore in newer versions."
883888
install-priority = 0
884889
license = 'MIT'
885890

mx.graalpython/verify_patches.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
}
6161

6262
SECTIONS = frozenset({'rules', 'add-sources'})
63-
RULE_KEYS = frozenset({'version', 'patch', 'license', 'subdir', 'dist-type', 'install-priority'})
63+
RULE_KEYS = frozenset({'version', 'patch', 'license', 'subdir', 'dist-type', 'install-priority', 'note'})
6464

6565

6666
def validate_metadata(patches_dir):

0 commit comments

Comments
 (0)