Skip to content

Commit aa76186

Browse files
committed
Remove legacy patch structure handling
1 parent 4abb838 commit aa76186

File tree

1 file changed

+2
-29
lines changed

1 file changed

+2
-29
lines changed

graalpython/lib-graalpython/patches/pip/pip-22.2.2.patch

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ index 1af8978..15fee7f 100644
9292
# file in .data maps to same location as file in wheel root).
9393
diff --git a/pip/_internal/utils/graalpy.py b/pip/_internal/utils/graalpy.py
9494
new file mode 100644
95-
index 0000000..0271d8a
95+
index 0000000..b8a506c
9696
--- /dev/null
9797
+++ b/pip/_internal/utils/graalpy.py
98-
@@ -0,0 +1,221 @@
98+
@@ -0,0 +1,194 @@
9999
+# ATTENTION: GraalPy uses existence of this module to verify that it is
100100
+# running a patched pip in pip_hook.py
101101
+import os
@@ -139,33 +139,6 @@ index 0000000..0271d8a
139139
+ for rule in metadata['rules']:
140140
+ if 'patch' in rule:
141141
+ rule['patch'] = package_dir / rule['patch']
142-
+ else:
143-
+ # TODO legacy structure, simplify when we get rid of ginstall
144-
+ metadata['rules'] = []
145-
+ for dist_type_dir in ('whl', 'sdist'):
146-
+ typedir = package_dir / dist_type_dir
147-
+ dist_type = 'sdist' if dist_type_dir == 'sdist' else 'wheel'
148-
+ if typedir.is_dir():
149-
+ files = sorted(typedir.iterdir(), key=lambda f: len(f.name), reverse=True)
150-
+ for file in files:
151-
+ if file.suffix == '.patch':
152-
+ if file.stem == denormalized_name:
153-
+ metadata['rules'].append({
154-
+ 'patch': str(file),
155-
+ 'dist-type': dist_type,
156-
+ })
157-
+ elif (version := file.stem.removeprefix(f'{denormalized_name}-')) != file.stem:
158-
+ metadata['rules'].append({
159-
+ 'version': f'== {version}.*',
160-
+ 'patch': file,
161-
+ 'dist-type': dist_type,
162-
+ })
163-
+ for file in files:
164-
+ if file.suffix == '.dir':
165-
+ with open(file) as f:
166-
+ subdir = f.read().strip()
167-
+ for rule in metadata['rules']:
168-
+ rule['subdir'] = subdir
169142
+ self._repository[normalized_name] = metadata
170143
+
171144
+ def get_rules(self, name):

0 commit comments

Comments
 (0)