Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the limitation of using azure packages in dependency #3166

Merged
merged 2 commits into from
Mar 19, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions scripts/ci/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from packaging import version
from wheel.install import WHEEL_INFO_RE

from util import get_ext_metadata, get_whl_from_url, get_index_data, verify_dependency
from util import get_ext_metadata, get_whl_from_url, get_index_data


def get_sha256sum(a_file):
Expand Down Expand Up @@ -183,13 +183,7 @@ def test_metadata(self):
"Metadata for {} in index doesn't match the expected of: \n"
"{}".format(item['filename'], json.dumps(metadata, indent=2, sort_keys=True,
separators=(',', ': '))))
run_requires = metadata.get('run_requires')
if run_requires:
deps = run_requires[0]['requires']
self.assertTrue(
all(verify_dependency(dep) for dep in deps),
"Dependencies of {} use disallowed extension dependencies. "
"Remove these dependencies: {}".format(item['filename'], deps))

shutil.rmtree(extensions_dir)


Expand Down
13 changes: 1 addition & 12 deletions scripts/ci/test_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from wheel.install import WHEEL_INFO_RE
from six import with_metaclass

from util import get_ext_metadata, verify_dependency, SRC_PATH
from util import SRC_PATH


ALL_TESTS = []
Expand Down Expand Up @@ -104,17 +104,6 @@ def test_source_wheels(self):
check_output(['python', 'setup.py', 'bdist_wheel', '-q', '-d', built_whl_dir], cwd=s)
except CalledProcessError as err:
self.fail("Unable to build extension {} : {}".format(s, err))
for filename in os.listdir(built_whl_dir):
ext_file = os.path.join(built_whl_dir, filename)
ext_dir = tempfile.mkdtemp(dir=built_whl_dir)
ext_name = WHEEL_INFO_RE(filename).groupdict().get('name')
metadata = get_ext_metadata(ext_dir, ext_file, ext_name)
run_requires = metadata.get('run_requires')
if run_requires:
deps = run_requires[0]['requires']
self.assertTrue(all(verify_dependency(dep) for dep in deps),
"Dependencies of {} use disallowed extension dependencies. "
"Remove these dependencies: {}".format(filename, deps))
shutil.rmtree(built_whl_dir)


Expand Down
7 changes: 0 additions & 7 deletions scripts/ci/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,3 @@ def get_index_data():
return json.load(f, object_pairs_hook=_catch_dup_keys)
except ValueError as err:
raise AssertionError("Invalid JSON in {}: {}".format(INDEX_PATH, err))


def verify_dependency(dep):
# ex. "azure-batch-extensions (<3.1,>=3.0.0)", "paho-mqtt (==1.3.1)", "pyyaml"
# check if 'azure-' dependency, as they use 'azure' namespace.
dep_split = dep.split()
return not (dep_split and dep_split[0].startswith('azure-') and dep_split[0] not in SKIP_DEP_CHECK)