From 92943a1a828e8bc95961150595e245c61968ab4f Mon Sep 17 00:00:00 2001 From: Lennart Reiher Date: Fri, 15 Nov 2024 13:39:00 +0100 Subject: [PATCH 1/2] fix template distribution with pip package --- ros2-pkg-create/pyproject.toml | 3 +++ ros2-pkg-create/src/ros2_pkg_create/__main__.py | 4 ++-- ros2-pkg-create/src/ros2_pkg_create/copier.yml | 1 + ros2-pkg-create/src/ros2_pkg_create/templates | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) create mode 120000 ros2-pkg-create/src/ros2_pkg_create/copier.yml create mode 120000 ros2-pkg-create/src/ros2_pkg_create/templates diff --git a/ros2-pkg-create/pyproject.toml b/ros2-pkg-create/pyproject.toml index c03d894..4fd35df 100644 --- a/ros2-pkg-create/pyproject.toml +++ b/ros2-pkg-create/pyproject.toml @@ -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/**"] \ No newline at end of file diff --git a/ros2-pkg-create/src/ros2_pkg_create/__main__.py b/ros2-pkg-create/src/ros2_pkg_create/__main__.py index 3d367d2..154945c 100644 --- a/ros2-pkg-create/src/ros2_pkg_create/__main__.py +++ b/ros2-pkg-create/src/ros2_pkg_create/__main__.py @@ -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") @@ -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, diff --git a/ros2-pkg-create/src/ros2_pkg_create/copier.yml b/ros2-pkg-create/src/ros2_pkg_create/copier.yml new file mode 120000 index 0000000..4454459 --- /dev/null +++ b/ros2-pkg-create/src/ros2_pkg_create/copier.yml @@ -0,0 +1 @@ +../../../copier.yml \ No newline at end of file diff --git a/ros2-pkg-create/src/ros2_pkg_create/templates b/ros2-pkg-create/src/ros2_pkg_create/templates new file mode 120000 index 0000000..64f6ba6 --- /dev/null +++ b/ros2-pkg-create/src/ros2_pkg_create/templates @@ -0,0 +1 @@ +../../../templates/ \ No newline at end of file From 45264f69ac56206d5b2d94e2975ab713a80dc9aa Mon Sep 17 00:00:00 2001 From: Lennart Reiher Date: Fri, 15 Nov 2024 13:40:58 +0100 Subject: [PATCH 2/2] bump version to v1.0.2 --- ros2-pkg-create/pyproject.toml | 2 +- ros2-pkg-create/src/ros2_pkg_create/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ros2-pkg-create/pyproject.toml b/ros2-pkg-create/pyproject.toml index 4fd35df..aa36bf5 100644 --- a/ros2-pkg-create/pyproject.toml +++ b/ros2-pkg-create/pyproject.toml @@ -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" diff --git a/ros2-pkg-create/src/ros2_pkg_create/__init__.py b/ros2-pkg-create/src/ros2_pkg_create/__init__.py index 0c97a9f..26153c4 100644 --- a/ros2-pkg-create/src/ros2_pkg_create/__init__.py +++ b/ros2-pkg-create/src/ros2_pkg_create/__init__.py @@ -1,2 +1,2 @@ __name__ = "ros2-pkg-create" -__version__ = "1.0.1" \ No newline at end of file +__version__ = "1.0.2" \ No newline at end of file