Skip to content

Commit

Permalink
add --skip-pip options
Browse files Browse the repository at this point in the history
  • Loading branch information
k-okada committed Dec 14, 2016
1 parent 1cb8457 commit 0ef6316
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
5 changes: 5 additions & 0 deletions bloom/commands/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
Expand Down
10 changes: 10 additions & 0 deletions bloom/generators/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@

from __future__ import print_function

from os import environ
import pkg_resources
import sys
import traceback

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
Expand Down Expand Up @@ -114,6 +116,14 @@ 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


Expand Down
5 changes: 4 additions & 1 deletion bloom/generators/debian/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,10 @@ 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))
Expand Down
5 changes: 4 additions & 1 deletion bloom/generators/rpm/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,10 @@ 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))
Expand Down

0 comments on commit 0ef6316

Please sign in to comment.