From d20b976ed67dc5599c4570175f7ba473fe660ad2 Mon Sep 17 00:00:00 2001 From: Derek Bekoe Date: Mon, 6 Nov 2017 15:02:32 -0800 Subject: [PATCH 1/2] Extension names use dash instead of underscore --- scripts/ci/test_integration.py | 11 ++++++++--- src/index.json | 6 +++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/scripts/ci/test_integration.py b/scripts/ci/test_integration.py index b0ffee75278..8b9bc0b3728 100755 --- a/scripts/ci/test_integration.py +++ b/scripts/ci/test_integration.py @@ -102,7 +102,7 @@ def get_ext_metadata(ext_dir, ext_file, ext_name): metadata.update(azext_metadata) for dist_info_dirname in dist_info_dirs: parsed_dist_info_dir = WHEEL_INFO_RE(dist_info_dirname) - if parsed_dist_info_dir and parsed_dist_info_dir.groupdict().get('name') == ext_name: + if parsed_dist_info_dir and parsed_dist_info_dir.groupdict().get('name') == ext_name.replace('-', '_'): whl_metadata_filepath = os.path.join(ext_dir, dist_info_dirname, WHL_METADATA_FILENAME) if os.path.isfile(whl_metadata_filepath): with open(whl_metadata_filepath) as f: @@ -134,11 +134,14 @@ def test_format_extensions_value(self): def test_extension_filenames(self): for ext_name, exts in self.index['extensions'].items(): + self.assertEqual(ext_name.find('_'), -1, "Extension names should not contain underscores. " + "Found {}".format(ext_name)) for item in exts: self.assertTrue(item['filename'].endswith('.whl'), "Filename {} must end with .whl".format(item['filename'])) - self.assertTrue(item['filename'].startswith(ext_name), - "Filename {} must start with {}".format(item['filename'], ext_name)) + self.assertEqual(ext_name, item['metadata']['name'], + "Extension name mismatch in extensions['{}']. " + "Found an extension in the list with name {}".format(ext_name, item['metadata']['name'])) parsed_filename = WHEEL_INFO_RE(item['filename']) p = parsed_filename.groupdict() self.assertTrue(p.get('name'), "Can't get name for {}".format(item['filename'])) @@ -224,6 +227,8 @@ def test_source_wheels(self): source_extensions = [os.path.join(SRC_PATH, n) for n in os.listdir(SRC_PATH) if os.path.isdir(os.path.join(SRC_PATH, n))] for s in source_extensions: + if not os.path.isfile(os.path.join(s, 'setup.py')): + continue try: subprocess.check_call(['python', 'setup.py', 'bdist_wheel', '-q', '-d', built_whl_dir], cwd=s, stdout=PIPE, stderr=PIPE) diff --git a/src/index.json b/src/index.json index aace38bf951..5b8525d305b 100644 --- a/src/index.json +++ b/src/index.json @@ -1,7 +1,7 @@ { "formatVersion": "1", "extensions": { - "azure_batch_cli_extensions": [ + "azure-batch-cli-extensions": [ { "filename": "azure_batch_cli_extensions-2.0.0-py2.py3-none-any.whl", "sha256Digest": "ccdfd15a2a33e2f3298e64051f556da76d7bec6e1008fd28a6467803df8ae8cb", @@ -35,7 +35,7 @@ } } ], - "azure_cli_iot_ext": [ + "azure-cli-iot-ext": [ { "filename": "azure_cli_iot_ext-0.1.1-py2.py3-none-any.whl", "sha256Digest": "28f5565fa0367da4694223bb8dfacd68be5213e6a49b3a463a10c2379c39da19", @@ -94,7 +94,7 @@ } } ], - "image_copy_extension": [ + "image-copy-extension": [ { "filename": "image_copy_extension-0.0.4-py2.py3-none-any.whl", "sha256Digest": "47d0f4293e833bb16bac1abbc63f7946dd87ac8db40378a230ec376d1f128fd3", From 340b6151535d0df4bd86f3d45c86b92f4a4ad887 Mon Sep 17 00:00:00 2001 From: Derek Bekoe Date: Mon, 6 Nov 2017 15:31:48 -0800 Subject: [PATCH 2/2] Fix CI --- scripts/ci/test_integration.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/ci/test_integration.py b/scripts/ci/test_integration.py index 8b9bc0b3728..c54e6d052ea 100755 --- a/scripts/ci/test_integration.py +++ b/scripts/ci/test_integration.py @@ -24,7 +24,7 @@ SRC_PATH = os.path.join(get_repo_root(), 'src') # Extensions to skip dep. check. Aim to keep this list empty. -SKIP_DEP_CHECK = ['azure_cli_iot_ext'] +SKIP_DEP_CHECK = ['azure-cli-iot-ext'] def catch_dup_keys(pairs): @@ -141,7 +141,8 @@ def test_extension_filenames(self): "Filename {} must end with .whl".format(item['filename'])) self.assertEqual(ext_name, item['metadata']['name'], "Extension name mismatch in extensions['{}']. " - "Found an extension in the list with name {}".format(ext_name, item['metadata']['name'])) + "Found an extension in the list with name " + "{}".format(ext_name, item['metadata']['name'])) parsed_filename = WHEEL_INFO_RE(item['filename']) p = parsed_filename.groupdict() self.assertTrue(p.get('name'), "Can't get name for {}".format(item['filename']))