def test_stack_rosdeps(self): import rosdeb from rosdeb.rosutil import stack_rosdeps from roslib.stacks import get_stack_dir # this test will have to be updated as we change our supported platform set platforms = ['lucid', 'jaunty', 'karmic'] # stick to stacks that should have high confidence of resolving properly stacks = [ 'ros', 'common', 'common_msgs', 'driver_common', 'geometry', 'image_common', 'image_pipeline', 'joystick_drivers', 'navigation', 'sound_drivers', 'visualization', 'visualization_common' ] base_reqd = rosdeb.rosutil.IMPLICIT_DEPS rosdeps = {} for platform in platforms: rosdeps[platform] = {} for stack_name in stacks: stack_dir = get_stack_dir(stack_name) rosdeps[platform][stack_name] = deps = stack_rosdeps( stack_name, stack_dir, platform) for reqd in base_reqd: self.assert_(reqd in deps) tests = [ ('ros', ['python-yaml']), ('ros_release', []), #('navigation', ['python-yaml', 'libnetpbm10-dev']), #('geometry', ['libglut3-dev', 'graphviz', 'python-sip4-dev', 'sip4']), ] # make sure common_msgs has no additional rosdeps for p in ['lucid', 'karmic', 'jaunty']: self.failIf(set(rosdeps[p]['common_msgs']) ^ set(base_reqd)) for stack, reqd in tests: for r in reqd: for p in ['lucid', 'karmic', 'jaunty']: self.assert_(r in rosdeps[p][stack], r)
def test_stack_rosdeps(self): import rosdeb from rosdeb.rosutil import stack_rosdeps from roslib.stacks import get_stack_dir # this test will have to be updated as we change our supported platform set platforms = ['lucid', 'jaunty', 'karmic'] # stick to stacks that should have high confidence of resolving properly stacks = ['ros', 'common', 'common_msgs', 'driver_common', 'geometry', 'image_common', 'image_pipeline', 'joystick_drivers', 'navigation', 'sound_drivers', 'visualization', 'visualization_common'] base_reqd = rosdeb.rosutil.IMPLICIT_DEPS rosdeps = {} for platform in platforms: rosdeps[platform] = {} for stack_name in stacks: stack_dir = get_stack_dir(stack_name) rosdeps[platform][stack_name] = deps = stack_rosdeps(stack_name, stack_dir, platform) for reqd in base_reqd: self.assert_(reqd in deps) tests = [ ('ros', ['python-yaml']), ('ros_release', []), #('navigation', ['python-yaml', 'libnetpbm10-dev']), #('geometry', ['libglut3-dev', 'graphviz', 'python-sip4-dev', 'sip4']), ] # make sure common_msgs has no additional rosdeps for p in ['lucid', 'karmic', 'jaunty']: self.failIf(set(rosdeps[p]['common_msgs']) ^ set(base_reqd)) for stack, reqd in tests: for r in reqd: for p in ['lucid', 'karmic', 'jaunty']: self.assert_(r in rosdeps[p][stack], r)
def control_data(stack_name, stack_version, md5sum, stack_file=None): """ Generate metadata for control file. Cannot generate debian dependencies as these are platform specific. @type stack_name: name of stack @type stack_name: str @type stack_version: stack version id @type stack_version: str @param stack_file: location of stack file, or None to use default rosstack lookup @type stack_file: str """ import roslib.stack_manifest if stack_file is None: stack_file = roslib.stack_manifest.stack_file(stack_name) m = roslib.stack_manifest.parse_file(stack_file) metadata = {} metadata['md5sum'] = md5sum #3301 metadata['stack'] = stack_name metadata['package'] = debianize_name(stack_name) metadata['version'] = stack_version metadata['homepage'] = m.url if m.author.startswith('Maintained by '): metadata['maintainer'] = m.author[len('Maintained by '):] else: metadata['maintainer'] = m.author metadata['priority'] = 'optional' if m.brief: # 60-char limit on control files metadata['description-brief'] = m.brief[:60] else: metadata['description-brief'] = m.brief[:60] try: description = convert_html_to_text(m.description).rstrip() except: description = "unknown" # per debian spec, single-space pad to signal paragraph desc_padded = '' for l in description.split('\n'): desc_padded += ' ' + l + '\n' metadata['description-full'] = desc_padded.rstrip() # do deps in two parts as ros stack depends need to become version # locked later on due to lack of ABI compat metadata['depends'] = [d.stack for d in m.depends] metadata['rosdeps'] = rosdeps = {} for platform in platforms(): try: rosdeps[platform] = stack_rosdeps(stack_name, os.path.dirname(stack_file), platform) except Exception as e: # #3435 # TODO: this is a hack that should be turned into a typed exception if "cannot generate" in str(e): sys.stderr.write("Error with platform [%s]: %s\n" % (platform, str(e))) # ignore other failures as these are generally unsupported # platforms. Later logic is responsible for erroring if # control file is missing bindings, and unit tests on # stack_rosdeps verify its functionality return metadata
def control_data(stack_name, stack_version, md5sum, stack_file=None): """ Generate metadata for control file. Cannot generate debian dependencies as these are platform specific. @type stack_name: name of stack @type stack_name: str @type stack_version: stack version id @type stack_version: str @param stack_file: location of stack file, or None to use default rosstack lookup @type stack_file: str """ import roslib.stack_manifest if stack_file is None: stack_file = roslib.stack_manifest.stack_file(stack_name) m = roslib.stack_manifest.parse_file(stack_file) metadata = {} metadata['md5sum'] = md5sum #3301 metadata['stack'] = stack_name metadata['package'] = debianize_name(stack_name) metadata['version'] = stack_version metadata['homepage'] = m.url if m.author.startswith('Maintained by '): metadata['maintainer'] = m.author[len('Maintained by '):] else: metadata['maintainer'] = m.author metadata['priority'] = 'optional' if m.brief: # 60-char limit on control files metadata['description-brief'] = m.brief[:60] else: metadata['description-brief'] = m.brief[:60] try: description = convert_html_to_text(m.description).rstrip() except: description = "unknown" # per debian spec, single-space pad to signal paragraph desc_padded = '' for l in description.split('\n'): desc_padded += ' '+l+'\n' metadata['description-full'] = desc_padded.rstrip() # do deps in two parts as ros stack depends need to become version # locked later on due to lack of ABI compat metadata['depends'] = [d.stack for d in m.depends] metadata['rosdeps'] = rosdeps = {} for platform in platforms(): try: rosdeps[platform] = stack_rosdeps(stack_name, os.path.dirname(stack_file), platform) except Exception as e: # #3435 # TODO: this is a hack that should be turned into a typed exception if "cannot generate" in str(e): sys.stderr.write("Error with platform [%s]: %s\n"%(platform, str(e))) # ignore other failures as these are generally unsupported # platforms. Later logic is responsible for erroring if # control file is missing bindings, and unit tests on # stack_rosdeps verify its functionality return metadata