|
14 | 14 | import json |
15 | 15 | import logging |
16 | 16 | import os |
| 17 | +import re |
17 | 18 | import shutil |
18 | 19 | import tempfile |
19 | 20 | import unittest |
20 | 21 |
|
21 | 22 | from packaging import version |
22 | 23 | from util import SRC_PATH |
23 | | -from wheel.install import WHEEL_INFO_RE |
24 | 24 |
|
25 | 25 | from util import get_ext_metadata, get_whl_from_url, get_index_data |
26 | 26 |
|
|
32 | 32 | logger.addHandler(ch) |
33 | 33 |
|
34 | 34 |
|
| 35 | +# copy from wheel==0.30.0 |
| 36 | +WHEEL_INFO_RE = re.compile( |
| 37 | + r"""^(?P<namever>(?P<name>.+?)(-(?P<ver>\d.+?))?) |
| 38 | + ((-(?P<build>\d.*?))?-(?P<pyver>.+?)-(?P<abi>.+?)-(?P<plat>.+?) |
| 39 | + \.whl|\.dist-info)$""", |
| 40 | + re.VERBOSE).match |
| 41 | + |
| 42 | + |
35 | 43 | def get_sha256sum(a_file): |
36 | 44 | sha256 = hashlib.sha256() |
37 | 45 | with open(a_file, 'rb') as f: |
@@ -85,8 +93,6 @@ def test_extension_filenames(self): |
85 | 93 | "Extension name mismatch in extensions['{}']. " |
86 | 94 | "Found an extension in the list with name " |
87 | 95 | "{}".format(ext_name, item['metadata']['name'])) |
88 | | - # Due to https://github.com/pypa/wheel/issues/235 we prevent whls built with 0.31.0 or greater. |
89 | | - # 0.29.0, 0.30.0 are the two previous versions before that release. |
90 | 96 | parsed_filename = WHEEL_INFO_RE(item['filename']) |
91 | 97 | p = parsed_filename.groupdict() |
92 | 98 | self.assertTrue(p.get('name'), "Can't get name for {}".format(item['filename'])) |
@@ -196,14 +202,13 @@ def test_metadata(self): |
196 | 202 | else: |
197 | 203 | raise ex |
198 | 204 |
|
199 | | - # Due to https://github.com/pypa/wheel/issues/195 we prevent whls built with 0.31.0 or greater. |
200 | | - # 0.29.0, 0.30.0 are the two previous versions before that release. |
201 | 205 | supported_generators = ['bdist_wheel (0.29.0)', 'bdist_wheel (0.30.0)'] |
202 | 206 | self.assertIn(metadata.get('generator'), supported_generators, |
203 | 207 | "{}: 'generator' should be one of {}. " |
204 | | - "Build the extension with a different version of the 'wheel' package " |
205 | | - "(e.g. `pip install wheel==0.30.0`). " |
206 | | - "This is due to https://github.com/pypa/wheel/issues/195".format(ext_name, |
| 208 | + "Please install the latest azdev." |
| 209 | + "(e.g. `pip install azdev==0.2.3b1 && `)." |
| 210 | + "And update the extension index with the latest azdev." |
| 211 | + "(e.g. `azdev extension update-index xxx.whl`).".format(ext_name, |
207 | 212 | supported_generators)) |
208 | 213 | self.assertDictEqual(metadata, item['metadata'], |
209 | 214 | "Metadata for {} in index doesn't match the expected of: \n" |
|
0 commit comments