From b1c1315f719d786448a4d6ec179f8424e0731b90 Mon Sep 17 00:00:00 2001 From: Kei Okada Date: Sun, 20 Nov 2016 14:05:29 +0900 Subject: [PATCH] add --skip-pip options --- bloom/commands/release.py | 5 +++++ bloom/generators/common.py | 7 +++++++ bloom/generators/debian/generator.py | 4 +++- bloom/generators/rpm/generator.py | 4 +++- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/bloom/commands/release.py b/bloom/commands/release.py index d6c33caa..049147ef 100644 --- a/bloom/commands/release.py +++ b/bloom/commands/release.py @@ -1259,6 +1259,8 @@ def get_argument_parser(): help="Pretends to push and release") add('--no-web', default=False, action='store_true', help="prevents a web browser from being opened at the end") + add('--skip-pip', default=False, action='store_true', + help="skip all pip rosdep keys") add('--pull-request-only', '-p', default=False, action='store_true', help="skips the release actions and only tries to open a pull request") add('--override-release-repository-url', default=None, @@ -1285,6 +1287,9 @@ def main(sysargs=None): if args.no_web: os.environ['BLOOM_NO_WEBBROWSER'] = '1' + if args.skip_pip: + os.environ['BLOOM_SKIP_PIP'] = '1' + try: os.environ['BLOOM_TRACK'] = args.track disable_git_clone(True) diff --git a/bloom/generators/common.py b/bloom/generators/common.py index 034001d1..92af4107 100644 --- a/bloom/generators/common.py +++ b/bloom/generators/common.py @@ -32,6 +32,7 @@ from __future__ import print_function +from os import environ import pkg_resources import sys import traceback @@ -39,6 +40,7 @@ from bloom.logging import debug from bloom.logging import error from bloom.logging import info +from bloom.logging import warning from bloom.util import code from bloom.util import maybe_continue @@ -114,6 +116,11 @@ def resolve_more_for_os(rosdep_key, view, installer, os_name, os_version): os_installers, default_os_installer) assert inst_key in os_installers + if 'BLOOM_SKIP_PIP' in environ and environ['BLOOM_SKIP_PIP'] == '1' and inst_key == 'pip': # force set rule to null for pip, we can escape pip in L.99(def resolve_more_for_os(rosdep_key, view, installer, os_name, os_version):) in bloom/generators/common.py ? + warning("Key '{0}' resolved to '{1}' with installer '{2}' for os '{3}' '{4}', " + "with 'BLOOM_SKIP_PIP' environment raviable, we intentinally skip this rules" + .format(rosdep_key,installer.resolve(rule), inst_key, os_name, os_version)) + return [], inst_key, default_os_installer return installer.resolve(rule), inst_key, default_os_installer diff --git a/bloom/generators/debian/generator.py b/bloom/generators/debian/generator.py index c6e3f268..9c1a708a 100644 --- a/bloom/generators/debian/generator.py +++ b/bloom/generators/debian/generator.py @@ -611,7 +611,9 @@ def _check_all_keys_are_valid(self, peer_packages): retry=False) if rule is None: continue - if installer_key != default_installer_key: + if 'BLOOM_SKIP_PIP' in os.environ and os.environ['BLOOM_SKIP_PIP'] == '1' and installer_key == 'pip': + pass + elif installer_key != default_installer_key: error("Key '{0}' resolved to '{1}' with installer '{2}', " "which does not match the default installer '{3}'." .format(key, rule, installer_key, default_installer_key)) diff --git a/bloom/generators/rpm/generator.py b/bloom/generators/rpm/generator.py index 9ba05c0d..e33166cc 100644 --- a/bloom/generators/rpm/generator.py +++ b/bloom/generators/rpm/generator.py @@ -511,7 +511,9 @@ def _check_all_keys_are_valid(self, peer_packages): retry=False) if rule is None: continue - if installer_key != default_installer_key: + if 'BLOOM_SKIP_PIP' in os.environ and os.environ['BLOOM_SKIP_PIP'] == '1' and installer_key == 'pip': + pass + elif installer_key != default_installer_key: error("Key '{0}' resolved to '{1}' with installer '{2}', " "which does not match the default installer '{3}'." .format(key, rule, installer_key, default_installer_key))