Esempio n. 1
0
    def add_arguments(self, *, parser):  # noqa: D102
        parser.add_argument(
            '--build-base',
            default='build',
            help='The base path for all build directories (default: build)')
        parser.add_argument(
            '--install-base',
            default='install',
            help='The base path for all install prefixes (default: install)')
        parser.add_argument(
            '--merge-install',
            action='store_true',
            help='Merge all install prefixes into a single location')
        parser.add_argument(
            '--symlink-install',
            action='store_true',
            help='Use symlinks instead of copying files where possible')
        parser.add_argument(
            '--test-result-base',
            help='The base path for all test results (default: --build-base)')
        parser.add_argument(
            '--continue-on-error',
            action='store_true',
            help='Continue other packages when a package fails to build '
            '(packages recursively depending on the failed package are '
            'skipped)')
        add_executor_arguments(parser)
        add_event_handler_arguments(parser)

        add_packages_arguments(parser)

        decorated_parser = DestinationCollectorDecorator(parser)
        add_task_arguments(decorated_parser, 'colcon_core.task.build')
        self.task_argument_destinations = decorated_parser.get_destinations()
Esempio n. 2
0
    def add_arguments(self, *, parser):  # noqa: D102
        parser.add_argument('--build-base', default='build',
                            help='The base path for all build directories ('
                                 'default: build)')
        parser.add_argument('--install-base', default='install',
                            help='The base path for all install prefixes ('
                                 'default: install)')
        parser.add_argument('--merge-install', action='store_true',
                            help='Merge all install prefixes into a single '
                                 'location')
        parser.add_argument('--bundle-base', default='bundle',
                            help='The base path for all bundle prefixes ('
                                 'default: bundle)')
        parser.add_argument(
            '--include-sources', action='store_true',
            help='Include a sources tarball for all packages installed into '
                 'the bundle via apt')
        parser.add_argument(
            '--bundle-version', default=2, type=int,
            help='Version of bundle to generate')
        parser.add_argument(
            '-U', '--upgrade', action='store_true',
            help='Upgrade all dependencies in the bundle to their latest '
                 'versions'
        )

        add_executor_arguments(parser)
        add_event_handler_arguments(parser)
        add_package_arguments(parser)

        decorated_parser = DestinationCollectorDecorator(parser)
        add_task_arguments(decorated_parser, 'colcon_bundle.task.bundle', )
        self.task_argument_destinations = decorated_parser.get_destinations()
        add_installer_arguments(decorated_parser)
Esempio n. 3
0
    def add_arguments(self, *, parser):  # noqa: D102
        parser.add_argument(
            '--build-base',
            default='build',
            help='The base path for all build directories (default: build)')
        parser.add_argument(
            '--install-base',
            default='install',
            help='The base path for all install prefixes (default: install)')
        parser.add_argument(
            '--merge-install',
            action='store_true',
            help='Merge all install prefixes into a single location')
        parser.add_argument(
            '--symlink-install',
            action='store_true',
            help='Use symlinks instead of copying files where possible')
        parser.add_argument(
            '--test-result-base',
            help='The base path for all test results (default: --build-base)')
        add_executor_arguments(parser)
        add_event_handler_arguments(parser)

        add_packages_arguments(parser)

        decorated_parser = DestinationCollectorDecorator(parser)
        add_task_arguments(decorated_parser, 'build')
        self.task_argument_destinations = decorated_parser.get_destinations()
Esempio n. 4
0
def test_add_event_handler_arguments():
    parser = argparse.ArgumentParser()
    with EntryPointContext(extension1=Extension1,
                           extension2=Extension2,
                           extension3=Extension3):
        add_event_handler_arguments(parser)
    text = parser.format_help()
    assert 'extension1- extension2+ extension3+' in text
    assert '* extension1:' in text
    assert 'Some doc block' in text
    assert '* extension2:' in text
    assert 'Other doc block' in text
Esempio n. 5
0
    def add_arguments(self, *, parser):  # noqa: D102
        parser.add_argument(
            '--base-select', nargs='*', metavar='BASE_NAME',
            default=sorted(get_base_handler_extensions().keys()),
            help='Select base names to clean in workspace '
                 '(default: [build, install, log, test_result])')

        parser.add_argument(
            '-y', '--yes',
            action='store_true',
            help='Automatic yes to prompts')
        add_base_handler_arguments(parser)
        add_event_handler_arguments(parser)
        add_packages_arguments(parser)
Esempio n. 6
0
    def add_arguments(self, *, parser):  # noqa: D102
        parser.add_argument(
            '--build-base',
            default='build',
            help='The base path for all build directories (default: build)')
        parser.add_argument(
            '--install-base',
            default='install',
            help='The base path for all install prefixes (default: install)')
        parser.add_argument(
            '--merge-install',
            action='store_true',
            help='Merge all install prefixes into a single location')
        parser.add_argument(
            '--test-result-base',
            help='The base path for all test results (default: --build-base)')
        group = parser.add_mutually_exclusive_group()
        group.add_argument(
            '--retest-until-fail',
            type=int, default=0, metavar='N',
            help='Rerun tests up to N times if they pass')
        group.add_argument(
            '--retest-until-pass',
            type=int, default=0, metavar='N',
            help='Rerun failing tests up to N times')
        parser.add_argument(
            '--abort-on-error',
            action='store_true',
            help='Abort after the first package with any errors (failing '
                 'tests are not considered errors in this context)')
        parser.add_argument(
            '--return-code-on-test-failure',
            action='store_true',
            help='Use a non-zero return code to indicate any test failure')
        add_executor_arguments(parser)
        add_event_handler_arguments(parser)

        add_packages_arguments(parser)

        decorated_parser = DestinationCollectorDecorator(parser)
        add_task_arguments(decorated_parser, 'colcon_core.task.test')
        self.task_argument_destinations = decorated_parser.get_destinations()
        self.task_argument_destinations['retest-until-pass'] = \
            'retest_until_pass'
        self.task_argument_destinations['retest-until-fail'] = \
            'retest_until_fail'
Esempio n. 7
0
    def add_arguments(self, *, parser):  # noqa: D102
        parser.add_argument('--build-base',
                            default='build',
                            help='The base path for all build directories ('
                            'default: build)')
        parser.add_argument('--install-base',
                            default='install',
                            help='The base path for all install prefixes ('
                            'default: install)')
        parser.add_argument('--merge-install',
                            action='store_true',
                            help='Merge all install prefixes into a single '
                            'location')
        parser.add_argument('--bundle-base',
                            default='bundle',
                            help='The base path for all bundle prefixes ('
                            'default: bundle)')
        parser.add_argument(
            '--include-sources',
            action='store_true',
            help='Include a sources tarball for all packages installed into '
            'the bundle via apt')
        parser.add_argument('--bundle-version',
                            default=1,
                            type=int,
                            help='Version of bundle to generate')

        parser.add_argument(
            '--use-cached-dependencies',
            action='store_true',
            help='Use this to skip download and installation of '
            'dependencies for quicker development cycles. This requires '
            'that you have already run "colcon bundle" successfully '
            'and all intermediate artifacts have been generated')

        add_executor_arguments(parser)
        add_event_handler_arguments(parser)
        add_package_arguments(parser)

        decorated_parser = DestinationCollectorDecorator(parser)
        add_task_arguments(
            decorated_parser,
            'colcon_bundle.task.bundle',
        )
        self.task_argument_destinations = decorated_parser.get_destinations()
        add_installer_arguments(decorated_parser)
Esempio n. 8
0
    def add_arguments(self, *, parser):  # noqa: D102
        parser.add_argument(
            '--build-base',
            default='build',
            help='The base path for all build directories (default: build)')

        parser.add_argument(
            '--ignore-dependencies',
            action='store_true',
            help='Ignore dependencies when capturing caches (default: false)')

        add_executor_arguments(parser)
        add_event_handler_arguments(parser)
        add_packages_arguments(parser)

        decorated_parser = DestinationCollectorDecorator(parser)
        add_task_arguments(decorated_parser, 'colcon_cache.task.lock')
        self.task_argument_destinations = decorated_parser.get_destinations()
Esempio n. 9
0
    def add_arguments(self, *, parser):  # noqa: D102
        if sys.version_info < (3, 8):
            # TODO(sloretz) remove when minimum supported Python version is 3.8
            parser.register('action', 'extend', _ExtendAction)
        parser.add_argument(
            '--build-base',
            default='build',
            help='The base path for all build directories (default: build)')
        parser.add_argument(
            '--install-base',
            default='install',
            help='The base path for all install prefixes (default: install)')
        parser.add_argument(
            '--merge-install',
            action='store_true',
            help='Merge all install prefixes into a single location')
        parser.add_argument(
            '--symlink-install',
            action='store_true',
            help='Use symlinks instead of copying files where possible')
        parser.add_argument(
            '--test-result-base',
            help='The base path for all test results (default: --build-base)')
        parser.add_argument(
            '--continue-on-error',
            action='store_true',
            help='Continue other packages when a package fails to build '
            '(packages recursively depending on the failed package are '
            'skipped)')
        parser.add_argument(
            '--allow-overriding',
            action='extend',
            default=[],
            metavar='PKG_NAME',
            nargs='+',
            help='Allow building packages that exist in underlay workspaces')
        add_executor_arguments(parser)
        add_event_handler_arguments(parser)

        add_packages_arguments(parser)

        decorated_parser = DestinationCollectorDecorator(parser)
        add_task_arguments(decorated_parser, 'colcon_core.task.build')
        self.task_argument_destinations = decorated_parser.get_destinations()
Esempio n. 10
0
 def add_arguments(self, *, parser):  # noqa: D102
     parser.add_argument(
         '--build-base',
         default='build',
         help='The base path for all build directories (default: build)'
     )
     parser.add_argument(
         '--lcov-base',
         default='lcov',
         help='The path for lcov artifacts (default: lcov)'
     )
     parser.add_argument(
         '--lcov-config-file',
         default=Path(__file__).parent / 'configuration' / 'lcovrc',
         help='The path to the lcov configuration (default: configuration/lcovrc)'
     )
     parser.add_argument(
         '--verbose',
         action='store_true',
         help='Show coverage rates for individual packages'
     )
     parser.add_argument(
         '--initial',
         action='store_true',
         help='Generate baseline (zero) coverage. This option is meant to be used before '
              'running `colcon test`'
     )
     parser.add_argument(
         '--zero-counters',
         action='store_true',
         help='Zero the coverage counters'
     )
     parser.add_argument(
         '--filter',
         nargs='*',
         help='Remove files matching FILTER from total coverage (e.g. "*/test/*")'
     )
     add_packages_arguments(parser)
     add_log_level_argument(parser)
     add_executor_arguments(parser)
     add_event_handler_arguments(parser)
Esempio n. 11
0
 def add_arguments(self, *, parser):  # noqa: D102
     parser.add_argument(
         '--build-base',
         default='build',
         help=
         'The base path for all build directories (default: %(default)s)',
     )
     parser.add_argument(
         '--coveragepy-base',
         default='coveragepy',
         help=
         'The path for coveragepy artifacts and outputs (default: %(default)s)',
     )
     parser.add_argument(
         '--coverage-report-args',
         nargs='*',
         metavar='*',
         type=str.lstrip,
         help="Pass arguments to 'coverage report'. Arguments matching "
         'other options must be prefixed by a space, '
         'e.g. --coverage-report-args " --help"',
     )
     parser.add_argument(
         '--coverage-html-args',
         nargs='*',
         metavar='*',
         type=str.lstrip,
         help="Pass arguments to 'coverage html'. Arguments matching "
         'other options must be prefixed by a space, '
         'e.g. --coverage-html-args " --help"',
     )
     parser.add_argument(
         '--verbose',
         action='store_true',
         help='Show coverage results for individual packages and overall',
     )
     add_packages_arguments(parser)
     add_log_level_argument(parser)
     add_executor_arguments(parser)
     add_event_handler_arguments(parser)