Skip to content

Commit 2fb8b93

Browse files
committed
Add patch for protobuf
1 parent b3748e7 commit 2fb8b93

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

graalpython/lib-graalpython/patches/metadata.toml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,10 +433,19 @@ patch = 'prompt_toolkit.patch'
433433
license = 'BSD-3-Clause'
434434

435435
[[protobuf.rules]]
436+
patch = 'protobuf.patch'
437+
license = 'BSD-3-Clause'
438+
# There are 'none-any' wheels on pypi, this is only needed on sdists
439+
dist-type = 'sdist'
440+
install-priority = 0
441+
442+
[[protobuf.rules]]
443+
# msimacek: This version doesn't exist, but the patch file is referenced from the tensorflow patch which I'm afraid to touch
436444
version = '== 3.21.9'
437-
# Also referenced outside of pip from tensorflow patches
438445
patch = 'protobuf-3.21.9.patch'
439446
license = 'BSD-3-Clause'
447+
dist-type = 'sdist'
448+
install-priority = 0
440449

441450
[[psycopg2.rules]]
442451
version = '<= 2.9.9'
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff --git a/google/protobuf/internal/api_implementation.py b/google/protobuf/internal/api_implementation.py
2+
index b40446b..48e684f 100644
3+
--- a/google/protobuf/internal/api_implementation.py
4+
+++ b/google/protobuf/internal/api_implementation.py
5+
@@ -70,8 +70,8 @@ if _implementation_type not in ('python', 'cpp', 'upb'):
6+
'supported. Please set to \'python\', \'cpp\' or '
7+
'\'upb\'.'.format(_implementation_type))
8+
9+
-if 'PyPy' in sys.version and _implementation_type == 'cpp':
10+
- warnings.warn('PyPy does not work yet with cpp protocol buffers. '
11+
+if sys.implementation.name in ('pypy', 'graalpy') and _implementation_type == 'cpp':
12+
+ warnings.warn('PyPy and GraalPy do not work yet with cpp protocol buffers. '
13+
'Falling back to the python implementation.')
14+
_implementation_type = 'python'
15+

0 commit comments

Comments
 (0)