From 7abcaf91972fe3d0e9af98f36b5ed479d1b696cc Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Thu, 27 Oct 2016 00:37:10 -0500 Subject: [PATCH] Add the ability to ignore requirements from a given package Some packages simply do not play well with others. One such case is "tempest" where time and time again it's unbound requirements break everything. This change allows the package indexer to examine remote repos and exclude packages from the global package building list by using the metadata value ``ignorerequirements=True``. When a package is ignored it can still be built within in a venv or used by referencing the git repos however it will no longer be part of the global wheel building package list. Change-Id: Iacf15eea14a2cd9c98bbb59d99e2a1ea94bd0a5b Closes-Bug: #1631992 Signed-off-by: Kevin Carter --- lookup/py_pkgs.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lookup/py_pkgs.py b/lookup/py_pkgs.py index 68e192b..1eb066c 100644 --- a/lookup/py_pkgs.py +++ b/lookup/py_pkgs.py @@ -85,9 +85,18 @@ def map_base_and_remote_packages(package, package_map): :type package: ``str`` :type package_map: ``dict`` """ + def check_for_ignore(p): + p_parts = GIT_PACKAGE_DEFAULT_PARTS.get(p) + if p_parts: + fragments = p_parts.get('fragments', '') or '' + if 'ignorerequirements=True' not in fragments: + package_map['packages'].add(p) + else: + package_map['packages'].add(p) + if package.startswith(('http:', 'https:', 'git+')): if '@' not in package: - package_map['packages'].add(package) + check_for_ignore(p=package) else: git_parts = git_pip_link_parse(package) package_name = git_parts[-2] @@ -106,7 +115,7 @@ def map_base_and_remote_packages(package, package_map): else: package_map['remote_packages'].add(package) else: - package_map['packages'].add(package) + check_for_ignore(p=package) def parse_remote_package_parts(package_map):