Skip to content

Commit

Permalink
Merge pull request #3 from ika-rwth-aachen/hotfix/template-packaging
Browse files Browse the repository at this point in the history
Critical hotfix: distribute templates with pip package
  • Loading branch information
lreiher authored Nov 15, 2024
2 parents 9b17ef8 + 45264f6 commit 1b8260b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion ros2-pkg-create/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "ros2-pkg-create"
version = "1.0.1"
version = "1.0.2"
description = "Powerful ROS 2 Package Generator"
license = {file = "LICENSE"}
readme = "README.md"
Expand Down Expand Up @@ -35,3 +35,6 @@ dev = ["build", "twine"]

[project.scripts]
ros2-pkg-create = "ros2_pkg_create.__main__:main"

[tool.setuptools.package-data]
ros2_pkg_create = ["copier.yml", "templates/**"]
2 changes: 1 addition & 1 deletion ros2-pkg-create/src/ros2_pkg_create/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__name__ = "ros2-pkg-create"
__version__ = "1.0.1"
__version__ = "1.0.2"
4 changes: 2 additions & 2 deletions ros2-pkg-create/src/ros2_pkg_create/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def parseArguments() -> argparse.Namespace:
parser.add_argument("--defaults", action="store_true", help="Use defaults for all options")
parser.add_argument("--use-local-templates", action="store_true", help="Use locally installed templates instead of remotely pulling most recent ones")

parser.add_argument("--template", type=str, default=None, choices=os.listdir(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, os.pardir, "templates")), required=True, help="Template")
parser.add_argument("--template", type=str, default=None, choices=os.listdir(os.path.join(os.path.dirname(__file__), "templates")), required=True, help="Template")
parser.add_argument("--package-name", type=str, default=None, help="Package name")
parser.add_argument("--description", type=str, default=None, help="Description")
parser.add_argument("--maintainer", type=str, default=None, help="Maintainer")
Expand Down Expand Up @@ -67,7 +67,7 @@ def main():
# run copier
try:
if args.use_local_templates:
template_location = os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, os.pardir)
template_location = os.path.join(os.path.dirname(__file__))
else:
template_location = "https://github.com/ika-rwth-aachen/ros2-pkg-create.git"
copier.run_copy(template_location,
Expand Down
1 change: 1 addition & 0 deletions ros2-pkg-create/src/ros2_pkg_create/copier.yml
1 change: 1 addition & 0 deletions ros2-pkg-create/src/ros2_pkg_create/templates

0 comments on commit 1b8260b

Please sign in to comment.