|
18 | 18 | mac_platforms,
|
19 | 19 | )
|
20 | 20 |
|
21 |
| -import pip._internal.utils.glibc |
22 | 21 | from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
23 | 22 |
|
24 | 23 | if MYPY_CHECK_RUNNING:
|
@@ -157,94 +156,6 @@ def get_platform():
|
157 | 156 | return result
|
158 | 157 |
|
159 | 158 |
|
160 |
| -def is_linux_armhf(): |
161 |
| - # type: () -> bool |
162 |
| - if get_platform() != "linux_armv7l": |
163 |
| - return False |
164 |
| - # hard-float ABI can be detected from the ELF header of the running |
165 |
| - # process |
166 |
| - try: |
167 |
| - with open(sys.executable, 'rb') as f: |
168 |
| - elf_header_raw = f.read(40) # read 40 first bytes of ELF header |
169 |
| - except (IOError, OSError, TypeError): |
170 |
| - return False |
171 |
| - if elf_header_raw is None or len(elf_header_raw) < 40: |
172 |
| - return False |
173 |
| - if isinstance(elf_header_raw, str): |
174 |
| - elf_header = [ord(c) for c in elf_header_raw] |
175 |
| - else: |
176 |
| - elf_header = [b for b in elf_header_raw] |
177 |
| - result = elf_header[0:4] == [0x7f, 0x45, 0x4c, 0x46] # ELF magic number |
178 |
| - result &= elf_header[4:5] == [1] # 32-bit ELF |
179 |
| - result &= elf_header[5:6] == [1] # little-endian |
180 |
| - result &= elf_header[18:20] == [0x28, 0] # ARM machine |
181 |
| - result &= elf_header[39:40] == [5] # ARM EABIv5 |
182 |
| - result &= (elf_header[37:38][0] & 4) == 4 # EF_ARM_ABI_FLOAT_HARD |
183 |
| - return result |
184 |
| - |
185 |
| - |
186 |
| -def is_manylinux1_compatible(): |
187 |
| - # type: () -> bool |
188 |
| - # Only Linux, and only x86-64 / i686 |
189 |
| - if get_platform() not in {"linux_x86_64", "linux_i686"}: |
190 |
| - return False |
191 |
| - |
192 |
| - # Check for presence of _manylinux module |
193 |
| - try: |
194 |
| - import _manylinux |
195 |
| - return bool(_manylinux.manylinux1_compatible) |
196 |
| - except (ImportError, AttributeError): |
197 |
| - # Fall through to heuristic check below |
198 |
| - pass |
199 |
| - |
200 |
| - # Check glibc version. CentOS 5 uses glibc 2.5. |
201 |
| - return pip._internal.utils.glibc.have_compatible_glibc(2, 5) |
202 |
| - |
203 |
| - |
204 |
| -def is_manylinux2010_compatible(): |
205 |
| - # type: () -> bool |
206 |
| - # Only Linux, and only x86-64 / i686 |
207 |
| - if get_platform() not in {"linux_x86_64", "linux_i686"}: |
208 |
| - return False |
209 |
| - |
210 |
| - # Check for presence of _manylinux module |
211 |
| - try: |
212 |
| - import _manylinux |
213 |
| - return bool(_manylinux.manylinux2010_compatible) |
214 |
| - except (ImportError, AttributeError): |
215 |
| - # Fall through to heuristic check below |
216 |
| - pass |
217 |
| - |
218 |
| - # Check glibc version. CentOS 6 uses glibc 2.12. |
219 |
| - return pip._internal.utils.glibc.have_compatible_glibc(2, 12) |
220 |
| - |
221 |
| - |
222 |
| -def is_manylinux2014_compatible(): |
223 |
| - # type: () -> bool |
224 |
| - # Only Linux, and only supported architectures |
225 |
| - platform = get_platform() |
226 |
| - if platform not in {"linux_x86_64", "linux_i686", "linux_aarch64", |
227 |
| - "linux_armv7l", "linux_ppc64", "linux_ppc64le", |
228 |
| - "linux_s390x"}: |
229 |
| - return False |
230 |
| - |
231 |
| - # check for hard-float ABI in case we're running linux_armv7l not to |
232 |
| - # install hard-float ABI wheel in a soft-float ABI environment |
233 |
| - if platform == "linux_armv7l" and not is_linux_armhf(): |
234 |
| - return False |
235 |
| - |
236 |
| - # Check for presence of _manylinux module |
237 |
| - try: |
238 |
| - import _manylinux |
239 |
| - return bool(_manylinux.manylinux2014_compatible) |
240 |
| - except (ImportError, AttributeError): |
241 |
| - # Fall through to heuristic check below |
242 |
| - pass |
243 |
| - |
244 |
| - # Check glibc version. CentOS 7 uses glibc 2.17. |
245 |
| - return pip._internal.utils.glibc.have_compatible_glibc(2, 17) |
246 |
| - |
247 |
| - |
248 | 159 | def get_all_minor_versions_as_strings(version_info):
|
249 | 160 | # type: (Tuple[int, ...]) -> List[str]
|
250 | 161 | versions = []
|
|
0 commit comments