Skip to content

Commit

Permalink
Support PEP 338 invocation of catkin_pkg modules
Browse files Browse the repository at this point in the history
This reverts part of f7dcb41, which
originally changed catkin_pkg to use 'console_scripts' instead of bare
'scripts' files.

PEP 338 invocation can be useful when invoking catkin_pkg functionality
with a specific interpreter, or without using setuptools to create the
'console_scripts' executables.
  • Loading branch information
cottsay committed Apr 2, 2024
1 parent 6b13f03 commit 7e0d082
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/catkin_pkg/cli/create_pkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,7 @@ def main(argv=sys.argv[1:], parent_path=os.getcwd()):
print('Successfully created files in %s. Please adjust the values in package.xml.' % target_path)
except ValueError as vae:
parser.error(str(vae))


if __name__ == '__main__':
sys.exit(main())
4 changes: 4 additions & 0 deletions src/catkin_pkg/cli/find_pkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@ def main(argv=sys.argv[1:]):
except RuntimeError as e:
print('ERROR: ' + str(e), file=sys.stderr)
sys.exit(1)


if __name__ == '__main__':
sys.exit(main())
4 changes: 4 additions & 0 deletions src/catkin_pkg/cli/generate_changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,7 @@ def main_catching_runtime_error(*args, **kwargs):
except RuntimeError as e:
print('ERROR: ' + str(e), file=sys.stderr)
sys.exit(1)


if __name__ == '__main__':
sys.exit(main_catching_runtime_error())
4 changes: 4 additions & 0 deletions src/catkin_pkg/cli/package_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ def main():
print('%s -> %s' % (version, new_version))
except Exception as e: # noqa: B902
sys.exit(str(e))


if __name__ == '__main__':
sys.exit(main())
4 changes: 4 additions & 0 deletions src/catkin_pkg/cli/prepare_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,3 +449,7 @@ def _main():
print(fmt('@{yf}%s' % msg))
else:
raise RuntimeError(fmt('@{rf}%s' % msg))


if __name__ == '__main__':
sys.exit(main())
4 changes: 4 additions & 0 deletions src/catkin_pkg/cli/tag_changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,7 @@ def main(sysargs=None):
for (changelog_path, data) in new_changelog_data:
with open(changelog_path, 'wb') as f:
f.write(data.encode('utf-8'))


if __name__ == '__main__':
sys.exit(main())
4 changes: 4 additions & 0 deletions src/catkin_pkg/cli/test_changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,7 @@ def main(sysargs=None):
changelog = Changelog()
with open(changelog_file, 'r') as f:
print(populate_changelog_from_rst(changelog, f.read()))


if __name__ == '__main__':
sys.exit(main())

0 comments on commit 7e0d082

Please sign in to comment.