Skip to content

Commit

Permalink
fix template distribution with pip package
Browse files Browse the repository at this point in the history
  • Loading branch information
lreiher committed Nov 15, 2024
1 parent 9b17ef8 commit 92943a1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions ros2-pkg-create/pyproject.toml
Original file line number Diff line number Diff line change
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/**"]
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 92943a1

Please sign in to comment.