Codebase list ros-catkin-pkg / 8732563
Update upstream source from tag 'upstream/0.4.23' Update to upstream version '0.4.23' with Debian dir 3a3f2f64c7633534252572355f5b058cbdc69c5f Jochen Sprickerhof 3 years ago
9 changed file(s) with 56 addition(s) and 24 deletion(s). Raw diff Collapse all Expand all
1919 # same version as in:
2020 # - src/catkin_pkg/__init__.py
2121 # - stdeb.cfg
22 'version': '0.4.22',
22 'version': '0.4.23',
2323 'packages': ['catkin_pkg', 'catkin_pkg.cli'],
2424 'package_dir': {'': 'src'},
2525 'package_data': {'catkin_pkg': ['templates/*.in']},
3434 # same version as in:
3535 # - setup.py
3636 # - stdeb.cfg
37 __version__ = '0.4.22'
37 __version__ = '0.4.23'
4747 FORTHCOMING_LABEL = 'Forthcoming'
4848
4949
50 def get_all_changes(vcs_client, skip_merges=False):
50 def get_all_changes(vcs_client, skip_merges=False, only_merges=False):
5151 tags = _get_version_tags(vcs_client)
5252
5353 # query all log entries per tag range
5555 previous_tag = Tag(None)
5656 for tag in sorted_tags(tags):
5757 log_entries = vcs_client.get_log_entries(
58 from_tag=previous_tag.name, to_tag=tag.name, skip_merges=skip_merges)
58 from_tag=previous_tag.name, to_tag=tag.name, skip_merges=skip_merges, only_merges=only_merges)
5959 tag2log_entries[previous_tag] = log_entries
6060 previous_tag = tag
6161 log_entries = vcs_client.get_log_entries(
62 from_tag=previous_tag.name, to_tag=None, skip_merges=skip_merges)
62 from_tag=previous_tag.name, to_tag=None, skip_merges=skip_merges, only_merges=only_merges)
6363 tag2log_entries[previous_tag] = log_entries
6464 return tag2log_entries
6565
6666
67 def get_forthcoming_changes(vcs_client, skip_merges=False):
67 def get_forthcoming_changes(vcs_client, skip_merges=False, only_merges=False):
6868 tags = _get_version_tags(vcs_client)
6969 latest_tag_name = _get_latest_version_tag_name(vcs_client)
7070
7878 # ignore non-forthcoming log entries but keep version to identify injection point of forthcoming
7979 tag2log_entries[tag] = None
8080 log_entries = vcs_client.get_log_entries(
81 from_tag=from_tag.name, to_tag=to_tag.name, skip_merges=skip_merges)
81 from_tag=from_tag.name, to_tag=to_tag.name, skip_merges=skip_merges, only_merges=only_merges)
8282 tag2log_entries[from_tag] = log_entries
8383 return tag2log_entries
8484
8787 def get_latest_tag_name(self):
8888 raise NotImplementedError()
8989
90 def get_log_entries(self, from_tag, to_tag, skip_merges=False):
90 def get_log_entries(self, from_tag, to_tag, skip_merges=False, only_merges=False):
9191 raise NotImplementedError()
9292
9393 def replace_repository_references(self, line):
178178 tag_name = result_describe['output']
179179 return tag_name
180180
181 def get_log_entries(self, from_tag, to_tag, skip_merges=False):
181 def get_log_entries(self, from_tag, to_tag, skip_merges=False, only_merges=False):
182182 # query all hashes in the range
183183 cmd = [self._executable, 'log']
184184 if from_tag or to_tag:
185185 cmd.append('%s%s' % ('%s..' % to_tag if to_tag else '', from_tag if from_tag else ''))
186186 cmd.append('--format=format:%H')
187 if skip_merges and only_merges:
188 raise RuntimeError('Both "skip_merges" and "only_merges" are set to True, which contradicts.')
187189 if skip_merges:
188190 cmd.append('--no-merges')
191 if only_merges:
192 cmd.append('--merges')
189193 result = self._run_command(cmd)
190194 if result['returncode']:
191195 raise RuntimeError('Could not fetch commit hashes:\n%s' % result['output'])
347351 raise RuntimeError('Could not find latest tagn')
348352 return tag_name
349353
350 def get_log_entries(self, from_tag, to_tag, skip_merges=False):
354 def get_log_entries(self, from_tag, to_tag, skip_merges=False, only_merges=False):
351355 # query all hashes in the range
352356 # ascending chronological order since than it is easier to handle empty tag names
353357 revrange = '%s:%s' % ((to_tag if to_tag else ''), (from_tag if from_tag else 'tip'))
3939
4040 def main(sysargs=None):
4141 parser = argparse.ArgumentParser(description='Generate a REP-0132 %s' % CHANGELOG_FILENAME)
42 group_merge = parser.add_mutually_exclusive_group()
4243 parser.add_argument(
4344 '-a', '--all', action='store_true', default=False,
4445 help='Generate changelog for all versions instead of only the forthcoming one (only supported when no changelog file exists yet)')
46 group_merge.add_argument(
47 '--only-merges', action='store_true', default=False,
48 help='Only add merge commits to the changelog')
4549 parser.add_argument(
4650 '--print-root', action='store_true', default=False,
4751 help='Output changelog content to the console as if there would be only one package in the root of the repository')
4852 parser.add_argument(
4953 '--skip-contributors', action='store_true', default=False,
5054 help='Skip adding the list of contributors to the changelog')
51 parser.add_argument(
55 group_merge.add_argument(
5256 '--skip-merges', action='store_true', default=False,
5357 help='Skip adding merge commits to the changelog')
5458 parser.add_argument(
6569 # printing status messages to stderr to allow piping the changelog to a file
6670 if args.all:
6771 print('Querying all tags and commit information...', file=sys.stderr)
68 tag2log_entries = get_all_changes(vcs_client, skip_merges=args.skip_merges)
72 tag2log_entries = get_all_changes(vcs_client, skip_merges=args.skip_merges, only_merges=args.only_merges)
6973 print('Generating changelog output with all versions...', file=sys.stderr)
7074 else:
7175 print('Querying commit information since latest tag...', file=sys.stderr)
72 tag2log_entries = get_forthcoming_changes(vcs_client, skip_merges=args.skip_merges)
76 tag2log_entries = get_forthcoming_changes(vcs_client, skip_merges=args.skip_merges, only_merges=args.only_merges)
7377 print('Generating changelog files with forthcoming version...', file=sys.stderr)
7478 print('', file=sys.stderr)
7579 data = generate_changelog_file('repository-level', tag2log_entries, vcs_client=vcs_client)
105109
106110 if args.all:
107111 print('Querying all tags and commit information...')
108 tag2log_entries = get_all_changes(vcs_client, skip_merges=args.skip_merges)
112 tag2log_entries = get_all_changes(vcs_client, skip_merges=args.skip_merges, only_merges=args.only_merges)
109113 print('Generating changelog files with all versions...')
110114 generate_changelogs(base_path, packages, tag2log_entries, logger=logging, vcs_client=vcs_client, skip_contributors=args.skip_contributors)
111115 else:
112116 print('Querying commit information since latest tag...')
113 tag2log_entries = get_forthcoming_changes(vcs_client, skip_merges=args.skip_merges)
117 tag2log_entries = get_forthcoming_changes(vcs_client, skip_merges=args.skip_merges, only_merges=args.only_merges)
114118 # separate packages with/without a changelog file
115119 packages_without = {pkg_path: package for pkg_path, package in packages.items() if package.name in missing_changelogs}
116120 if packages_without:
4949 value = pp.Word(pp.alphanums + '_-').setName('value')
5050 value.setParseAction(_Value)
5151
52 comparison_term = identifier | value
52 double_quoted_value = pp.QuotedString('"').setName(
53 'double_quoted_value')
54 double_quoted_value.setParseAction(_Value)
55 single_quoted_value = pp.QuotedString("'").setName(
56 'single_quoted_value')
57 single_quoted_value.setParseAction(_Value)
58
59 comparison_term = identifier | value | double_quoted_value | \
60 single_quoted_value
5361
5462 condition = pp.Group(comparison_term + operator + comparison_term).setName('condition')
5563 condition.setParseAction(_Condition)
337337 def __eq__(self, other):
338338 if not isinstance(other, Dependency):
339339 return False
340 return all(getattr(self, attr) == getattr(other, attr) for attr in self.__slots__)
340 return all(getattr(self, attr) == getattr(other, attr) for attr in self.__slots__ if attr != 'evaluated_condition')
341341
342342 def __hash__(self):
343343 return hash(tuple(getattr(self, slot) for slot in self.__slots__))
671671 depends = _get_dependencies(root, 'depend')
672672 for dep in depends:
673673 # check for collisions with specific dependencies
674 same_build_depends = ['build_depend' for d in pkg.build_depends if d.name == dep.name]
675 same_build_export_depends = ['build_export_depend' for d in pkg.build_export_depends if d.name == dep.name]
676 same_exec_depends = ['exec_depend' for d in pkg.exec_depends if d.name == dep.name]
674 same_build_depends = ['build_depend' for d in pkg.build_depends if d == dep]
675 same_build_export_depends = ['build_export_depend' for d in pkg.build_export_depends if d == dep]
676 same_exec_depends = ['exec_depend' for d in pkg.exec_depends if d == dep]
677677 if same_build_depends or same_build_export_depends or same_exec_depends:
678678 errors.append("The generic dependency on '%s' is redundant with: %s" % (dep.name, ', '.join(same_build_depends + same_build_export_depends + same_exec_depends)))
679679 # only append non-duplicates
694694
695695 if pkg.package_format == 1:
696696 for test_depend in pkg.test_depends:
697 same_build_depends = ['build_depend' for d in pkg.build_depends if d.name == test_depend.name]
698 same_run_depends = ['run_depend' for d in pkg.run_depends if d.name == test_depend.name]
697 same_build_depends = ['build_depend' for d in pkg.build_depends if d == test_depend]
698 same_run_depends = ['run_depend' for d in pkg.run_depends if d == test_depend]
699699 if same_build_depends or same_run_depends:
700700 errors.append('The test dependency on "%s" is redundant with: %s' % (test_depend.name, ', '.join(same_build_depends + same_run_depends)))
701701
22 ; catkin-pkg-modules same version as in:
33 ; - setup.py
44 ; - src/catkin_pkg/__init__.py
5 Depends: python-argparse, python-catkin-pkg-modules (>= 0.4.22), python-dateutil, python-docutils
5 Depends: python-argparse, python-catkin-pkg-modules (>= 0.4.23), python-dateutil, python-docutils
66 ; catkin-pkg-modules same version as in:
77 ; - setup.py
88 ; - src/catkin_pkg/__init__.py
9 Depends3: python3-catkin-pkg-modules (>= 0.4.22), python3-dateutil, python3-docutils
9 Depends3: python3-catkin-pkg-modules (>= 0.4.23), python3-dateutil, python3-docutils
1010 Conflicts: catkin, python3-catkin-pkg
1111 Conflicts3: catkin, python-catkin-pkg
1212 Copyright-File: LICENSE
118118 self.assertTrue(dep.evaluate_condition({}))
119119
120120 dep = Dependency('foo', condition='foo <= bar or bar >= baz')
121 self.assertFalse(dep.evaluate_condition({}))
122
123 dep = Dependency('foo', condition='$foo == ""')
124 self.assertTrue(dep.evaluate_condition({}))
125 self.assertFalse(dep.evaluate_condition({'foo': 'foo'}))
126
127 dep = Dependency('foo', condition='$foo == "foo \' bar"')
128 self.assertTrue(dep.evaluate_condition({'foo': "foo ' bar"}))
129 self.assertFalse(dep.evaluate_condition({}))
130
131 dep = Dependency('foo', condition="$foo == ''")
132 self.assertTrue(dep.evaluate_condition({}))
133 self.assertFalse(dep.evaluate_condition({'foo': 'foo'}))
134
135 dep = Dependency('foo', condition="$foo == 'foo \" bar'")
136 self.assertTrue(dep.evaluate_condition({'foo': 'foo " bar'}))
121137 self.assertFalse(dep.evaluate_condition({}))
122138
123139 # Testing for more than 1 conditions