From 775e74d5650c4c90a5fe1c08212193b984462020 Mon Sep 17 00:00:00 2001 From: huyenngn Date: Wed, 15 Nov 2023 10:12:20 +0100 Subject: [PATCH] refactor: Rename to capella-ros-tools --- .github/workflows/build-test-publish.yml | 3 +- .github/workflows/lint.yml | 2 +- .gitmodules | 8 +- .pre-commit-config.yaml | 194 +++++++++--------- CONTRIBUTING.md | 169 ++++++++------- README.md | 16 +- .../__init__.py | 4 +- capella_ros_tools/__main__.py | 24 +++ .../capella2msg.py | 12 +- .../modules/__init__.py | 0 .../modules/parse_capella.py | 0 .../modules/parse_message.py | 0 .../modules/serialize_capella.py | 0 .../modules/serialize_message.py | 0 .../msg2capella.py | 12 +- docs/source/conf.py | 8 +- docs/source/index.rst | 4 +- pyproject.toml | 16 +- rosidl2capella/__main__.py | 24 --- tests/test_rosidl2capella.py | 2 +- 20 files changed, 248 insertions(+), 250 deletions(-) rename {rosidl2capella => capella_ros_tools}/__init__.py (70%) create mode 100644 capella_ros_tools/__main__.py rename {rosidl2capella => capella_ros_tools}/capella2msg.py (90%) rename {rosidl2capella => capella_ros_tools}/modules/__init__.py (100%) rename {rosidl2capella => capella_ros_tools}/modules/parse_capella.py (100%) rename {rosidl2capella => capella_ros_tools}/modules/parse_message.py (100%) rename {rosidl2capella => capella_ros_tools}/modules/serialize_capella.py (100%) rename {rosidl2capella => capella_ros_tools}/modules/serialize_message.py (100%) rename {rosidl2capella => capella_ros_tools}/msg2capella.py (93%) delete mode 100644 rosidl2capella/__main__.py diff --git a/.github/workflows/build-test-publish.yml b/.github/workflows/build-test-publish.yml index 7e7b3af..25618e2 100644 --- a/.github/workflows/build-test-publish.yml +++ b/.github/workflows/build-test-publish.yml @@ -19,6 +19,7 @@ jobs: os: [ubuntu-latest] python_version: - "3.10" + - "3.11" include: - os: windows-latest python_version: "3.10" @@ -43,7 +44,7 @@ jobs: python -m pip install '.[test]' - name: Run unit tests run: |- - python -m pytest --cov-report=term --cov=rosidl2capella --rootdir=. + python -m pytest --cov-report=term --cov=capella_ros_tools --rootdir=. publish: name: Publish artifacts diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 3a3b97d..f4ef5e6 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -39,4 +39,4 @@ jobs: python -m pip install pylint - name: Run pylint run: |- - pylint -dfixme rosidl2capella || exit $(($? & ~24)) + pylint -dfixme capella_ros_tools || exit $(($? & ~24)) diff --git a/.gitmodules b/.gitmodules index be6d6e6..80c8b4c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,9 @@ # Copyright DB Netz AG and contributors # SPDX-License-Identifier: CC0-1.0 -[submodule "rosidl2capella/ros_interfaces/common_interfaces"] - path = rosidl2capella/ros_interfaces/common_interfaces +[submodule "capella_ros_tools/ros_interfaces/common_interfaces"] + path = capella_ros_tools/ros_interfaces/common_interfaces url = https://github.com/ros2/common_interfaces.git -[submodule "rosidl2capella/ros_interfaces/rcl_interfaces"] - path = rosidl2capella/ros_interfaces/rcl_interfaces +[submodule "capella_ros_tools/ros_interfaces/rcl_interfaces"] + path = capella_ros_tools/ros_interfaces/rcl_interfaces url = https://github.com/ros2/rcl_interfaces.git diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index caf8bff..7315f4a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,100 +4,100 @@ default_install_hook_types: [commit-msg, pre-commit] default_stages: [commit, merge-commit] repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 - hooks: - - id: check-added-large-files - - id: check-ast - - id: check-builtin-literals - - id: check-case-conflict - - id: check-executables-have-shebangs - - id: check-json - - id: check-merge-conflict - - id: check-shebang-scripts-are-executable - - id: check-symlinks - - id: check-toml - - id: check-vcs-permalinks - - id: check-xml - - id: check-yaml - - id: debug-statements - - id: destroyed-symlinks - - id: end-of-file-fixer - - id: fix-byte-order-marker - - id: trailing-whitespace - - repo: https://github.com/psf/black-pre-commit-mirror - rev: 23.9.1 - hooks: - - id: black - - repo: https://github.com/PyCQA/isort - rev: 5.12.0 - hooks: - - id: isort - - repo: https://github.com/PyCQA/docformatter - rev: v1.7.5 - hooks: - - id: docformatter - additional_dependencies: - - docformatter[tomli] - - repo: https://github.com/PyCQA/pydocstyle - rev: 6.3.0 - hooks: - - id: pydocstyle - exclude: '^tests/' - additional_dependencies: - - pydocstyle[toml] - - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.5.1 - hooks: - - id: mypy - - repo: https://github.com/Lucas-C/pre-commit-hooks - rev: v1.4.2 - hooks: - - id: insert-license - name: Insert license headers (shell-style comments) - files: '(?:^|/)(?:.*\.(?:py|sh|toml|ya?ml)|Dockerfile|Makefile)$' - exclude: '(?:^|/)\..+|^docs/Makefile$' - args: - - --detect-license-in-X-top-lines=15 - - --license-filepath - - LICENSES/.license_header.txt - - --comment-style - - '#' - - id: insert-license - name: Insert license headers (XML-style comments) - files: '\.(?:html|md|xml)$' - exclude: '(?:^|/)\..+' - args: - - --detect-license-in-X-top-lines=15 - - --license-filepath - - LICENSES/.license_header.txt - - --comment-style - - '' - - id: insert-license - name: Insert license headers (C-style comments) - files: '\.(?:css|js|ts)$' - exclude: '(?:^|/)\..+' - args: - - --detect-license-in-X-top-lines=15 - - --license-filepath - - LICENSES/.license_header.txt - - --comment-style - - '/*| *| */' - - id: insert-license - name: Insert license headers (reST comments) - files: '\.rst$' - exclude: '(?:^|/)\..+' - args: - - --detect-license-in-X-top-lines=15 - - --license-filepath - - LICENSES/.license_header.txt - - --comment-style - - '..| |' - - repo: https://github.com/fsfe/reuse-tool - rev: v2.1.0 - hooks: - - id: reuse - - repo: https://github.com/qoomon/git-conventional-commits - rev: v2.6.5 - hooks: - - id: conventional-commits + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: check-added-large-files + - id: check-ast + - id: check-builtin-literals + - id: check-case-conflict + - id: check-executables-have-shebangs + - id: check-json + - id: check-merge-conflict + - id: check-shebang-scripts-are-executable + - id: check-symlinks + - id: check-toml + - id: check-vcs-permalinks + - id: check-xml + - id: check-yaml + - id: debug-statements + - id: destroyed-symlinks + - id: end-of-file-fixer + - id: fix-byte-order-marker + - id: trailing-whitespace + - repo: https://github.com/psf/black-pre-commit-mirror + rev: 23.9.1 + hooks: + - id: black + - repo: https://github.com/PyCQA/isort + rev: 5.12.0 + hooks: + - id: isort + - repo: https://github.com/PyCQA/docformatter + rev: v1.7.5 + hooks: + - id: docformatter + additional_dependencies: + - docformatter[tomli] + - repo: https://github.com/PyCQA/pydocstyle + rev: 6.3.0 + hooks: + - id: pydocstyle + exclude: "^tests/" + additional_dependencies: + - pydocstyle[toml] + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.5.1 + hooks: + - id: mypy + - repo: https://github.com/Lucas-C/pre-commit-hooks + rev: v1.4.2 + hooks: + - id: insert-license + name: Insert license headers (shell-style comments) + files: '(?:^|/)(?:.*\.(?:py|sh|toml|ya?ml)|Dockerfile|Makefile)$' + exclude: '(?:^|/)\..+|^docs/Makefile$' + args: + - --detect-license-in-X-top-lines=15 + - --license-filepath + - LICENSES/.license_header.txt + - --comment-style + - "#" + - id: insert-license + name: Insert license headers (XML-style comments) + files: '\.(?:html|md|xml)$' + exclude: '(?:^|/)\..+' + args: + - --detect-license-in-X-top-lines=15 + - --license-filepath + - LICENSES/.license_header.txt + - --comment-style + - "" + - id: insert-license + name: Insert license headers (C-style comments) + files: '\.(?:css|js|ts)$' + exclude: '(?:^|/)\..+' + args: + - --detect-license-in-X-top-lines=15 + - --license-filepath + - LICENSES/.license_header.txt + - --comment-style + - "/*| *| */" + - id: insert-license + name: Insert license headers (reST comments) + files: '\.rst$' + exclude: '(?:^|/)\..+' + args: + - --detect-license-in-X-top-lines=15 + - --license-filepath + - LICENSES/.license_header.txt + - --comment-style + - "..| |" + - repo: https://github.com/fsfe/reuse-tool + rev: v2.1.0 + hooks: + - id: reuse + - repo: https://github.com/qoomon/git-conventional-commits + rev: v2.6.5 + hooks: + - id: conventional-commits diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 79d4dca..7a4c73a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,8 +16,8 @@ reduce the burden on our maintainers, please make sure that your code follows our style guidelines outlined below. -[open an issue]: https://github.com/DSD-DBS/rosidl2capella/issues -[open a pull request]: https://github.com/DSD-DBS/rosidl2capella/pulls +[open an issue]: https://github.com/DSD-DBS/capella-ros-tools/issues +[open a pull request]: https://github.com/DSD-DBS/capella-ros-tools/pulls ## Developing @@ -32,41 +32,41 @@ pytest We additionally recommend that you set up your editor / IDE as follows. -- Indent with 4 spaces per level of indentation +- Indent with 4 spaces per level of indentation -- Maximum line length of 79 (add a ruler / thin line / highlighting / ...) +- Maximum line length of 79 (add a ruler / thin line / highlighting / ...) -- _If you use Visual Studio Code_: Consider using a platform which supports - third-party language servers more easily, and continue with the next point. +- _If you use Visual Studio Code_: Consider using a platform which supports + third-party language servers more easily, and continue with the next point. - Otherwise, set up the editor to run `black`, `pylint` and `mypy` when saving. - To enable automatic import sorting with `isort`, add the following to your - `settings.json`: + Otherwise, set up the editor to run `black`, `pylint` and `mypy` when saving. + To enable automatic import sorting with `isort`, add the following to your + `settings.json`: - ```json - "[python]": { - "editor.codeActionsOnSave": { - "source.organizeImports": true - } - } - ``` + ```json + "[python]": { + "editor.codeActionsOnSave": { + "source.organizeImports": true + } + } + ``` - Note that the Pylance language server is not recommended, as it occasionally - causes false-positive errors for perfectly valid code. + Note that the Pylance language server is not recommended, as it occasionally + causes false-positive errors for perfectly valid code. -- _If you do not use VSC_: Set up your editor to use the [python-lsp-server], - and make sure that the relevant plugins are installed. You can install - everything that's needed into the virtualenv with pip: +- _If you do not use VSC_: Set up your editor to use the [python-lsp-server], + and make sure that the relevant plugins are installed. You can install + everything that's needed into the virtualenv with pip: - [python-lsp-server]: https://github.com/python-lsp/python-lsp-server + [python-lsp-server]: https://github.com/python-lsp/python-lsp-server - ```sh - pip install "python-lsp-server[pylint]" python-lsp-black pyls-isort pylsp-mypy - ``` + ```sh + pip install "python-lsp-server[pylint]" python-lsp-black pyls-isort pylsp-mypy + ``` - This will provide as-you-type linting as well as automatic formatting on - save. Language server clients are available for a wide range of editors, from - Vim/Emacs to PyCharm/IDEA. + This will provide as-you-type linting as well as automatic formatting on + save. Language server clients are available for a wide range of editors, from + Vim/Emacs to PyCharm/IDEA. ## Code style @@ -74,81 +74,78 @@ We base our code style on a modified version of the [Google style guide for Python code](https://google.github.io/styleguide/pyguide.html). The key differences are: -- **Docstrings**: The [Numpy style guide] applies here. +- **Docstrings**: The [Numpy style guide] applies here. - [numpy style guide]: - https://numpydoc.readthedocs.io/en/latest/format.html#docstring-standard + [numpy style guide]: https://numpydoc.readthedocs.io/en/latest/format.html#docstring-standard - When writing docstrings for functions, use the imperative style, as per - [PEP-257]). For example, write "Do X and Y" instead of "Does X and Y". + When writing docstrings for functions, use the imperative style, as per + [PEP-257]). For example, write "Do X and Y" instead of "Does X and Y". - [pep-257]: https://peps.python.org/pep-0257/ + [pep-257]: https://peps.python.org/pep-0257/ -- **Overridden methods**: If the documentation did not change from the base - class (i.e. the base class' method's docstring still applies without - modification), do not add a short docstring á la "See base class". This lets - automated tools pick up the full base class docstring instead, and is - therefore more useful in IDEs etc. +- **Overridden methods**: If the documentation did not change from the base + class (i.e. the base class' method's docstring still applies without + modification), do not add a short docstring á la "See base class". This lets + automated tools pick up the full base class docstring instead, and is + therefore more useful in IDEs etc. -- **Linting**: Use [pylint] for static code analysis, and [mypy] for static - type checking. +- **Linting**: Use [pylint] for static code analysis, and [mypy] for static + type checking. - [pylint]: https://github.com/PyCQA/pylint - [mypy]: https://github.com/python/mypy + [pylint]: https://github.com/PyCQA/pylint + [mypy]: https://github.com/python/mypy -- **Formatting**: Use [black] as code auto-formatter. The maximum line length - is 79, as per [PEP-8]. This setting should be automatically picked up from - the `pyproject.toml` file. The reason for the shorter line length is that it - avoids wrapping and overflows in side-by-side split views (e.g. diffs) if - there's also information displayed to the side of it (e.g. a tree view of the - modified files). +- **Formatting**: Use [black] as code auto-formatter. The maximum line length + is 79, as per [PEP-8]. This setting should be automatically picked up from + the `pyproject.toml` file. The reason for the shorter line length is that it + avoids wrapping and overflows in side-by-side split views (e.g. diffs) if + there's also information displayed to the side of it (e.g. a tree view of the + modified files). - [black]: https://github.com/psf/black - [pep-8]: https://www.python.org/dev/peps/pep-0008/ + [black]: https://github.com/psf/black + [pep-8]: https://www.python.org/dev/peps/pep-0008/ - Be aware of the different line length of 72 for docstrings. We currently do - not have a satisfactory solution to automatically apply or enforce this. + Be aware of the different line length of 72 for docstrings. We currently do + not have a satisfactory solution to automatically apply or enforce this. - Note that, while you're encouraged to do so in general, it is not a hard - requirement to break up long strings into smaller parts. Additionally, never - break up strings that are presented to the user in e.g. log messages, as that - makes it significantly harder to grep for them. + Note that, while you're encouraged to do so in general, it is not a hard + requirement to break up long strings into smaller parts. Additionally, never + break up strings that are presented to the user in e.g. log messages, as that + makes it significantly harder to grep for them. - Use [isort] for automatic sorting of imports. Its settings should - automatically be picked up from the `pyproject.toml` file as well. + Use [isort] for automatic sorting of imports. Its settings should + automatically be picked up from the `pyproject.toml` file as well. - [isort]: https://github.com/PyCQA/isort + [isort]: https://github.com/PyCQA/isort -- **Typing**: We do not make an exception for `typing` imports. Instead of - writing `from typing import SomeName`, use `import typing as t` and access - typing related classes like `t.TypedDict`. +- **Typing**: We do not make an exception for `typing` imports. Instead of + writing `from typing import SomeName`, use `import typing as t` and access + typing related classes like `t.TypedDict`. - + + Use the new syntax and classes for typing introduced with Python 3.10. - Use the new syntax and classes for typing introduced with Python 3.10. + - Instead of `t.Tuple`, `t.List` etc. use the builtin classes `tuple`, `list` + etc. + - For classes that are not builtin (e.g. `Iterable`), + `import collections.abc as cabc` and then use them like `cabc.Iterable`. + - Use [PEP-604-style unions], e.g. `int | float` instead of + `t.Union[int, float]`. + - Use `... | None` (with `None` always as the last union member) instead of + `t.Optional[...]` and always explicitly annotate where `None` is possible. - - Instead of `t.Tuple`, `t.List` etc. use the builtin classes `tuple`, `list` - etc. - - For classes that are not builtin (e.g. `Iterable`), - `import collections.abc as cabc` and then use them like `cabc.Iterable`. - - Use [PEP-604-style unions], e.g. `int | float` instead of - `t.Union[int, float]`. - - Use `... | None` (with `None` always as the last union member) instead of - `t.Optional[...]` and always explicitly annotate where `None` is possible. + [pep-604-style unions]: https://www.python.org/dev/peps/pep-0604/ - [pep-604-style unions]: https://www.python.org/dev/peps/pep-0604/ +- **Python style rules**: For conflicting parts, the [Black code style] wins. + If you have set up black correctly, you don't need to worry about this though + :) -- **Python style rules**: For conflicting parts, the [Black code style] wins. - If you have set up black correctly, you don't need to worry about this though - :) + [black code style]: https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html - [black code style]: - https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html +- When working with `dict`s, consider using `t.TypedDict` instead of a more + generic `dict[str, float|int|str]`-like annotation where possible, as the + latter is much less precise (often requiring additional `assert`s or + `isinstance` checks to pass) and can grow unwieldy very quickly. -- When working with `dict`s, consider using `t.TypedDict` instead of a more - generic `dict[str, float|int|str]`-like annotation where possible, as the - latter is much less precise (often requiring additional `assert`s or - `isinstance` checks to pass) and can grow unwieldy very quickly. - -- Prefer `t.NamedTuple` over `collections.namedtuple`, because the former uses - a more convenient `class ...:` syntax and also supports type annotations. +- Prefer `t.NamedTuple` over `collections.namedtuple`, because the former uses + a more convenient `class ...:` syntax and also supports type annotations. diff --git a/README.md b/README.md index 6fc2661..0c89465 100644 --- a/README.md +++ b/README.md @@ -3,31 +3,31 @@ ~ SPDX-License-Identifier: Apache-2.0 --> -# rosidl2capella +# capella-ros-tools -![image](https://github.com/DSD-DBS/rosidl2capella/actions/workflows/build-test-publish.yml/badge.svg) -![image](https://github.com/DSD-DBS/rosidl2capella/actions/workflows/lint.yml/badge.svg) +![image](https://github.com/DSD-DBS/capella-ros-tools/actions/workflows/build-test-publish.yml/badge.svg) +![image](https://github.com/DSD-DBS/capella-ros-tools/actions/workflows/lint.yml/badge.svg) -Tool for parsing ROS IDL (.msg files) and converting them to Capella model. +Tools for using ROS with Capella # Documentation -Read the [full documentation on Github pages](https://dsd-dbs.github.io/rosidl2capella). +Read the [full documentation on Github pages](https://dsd-dbs.github.io/capella-ros-tools). # Installation You can install the latest released version directly from PyPI. ```sh -pip install rosidl2capella +pip install capella-ros-tools ``` To set up a development environment, clone the project and install it into a virtual environment. ```sh -git clone https://github.com/DSD-DBS/rosidl2capella -cd rosidl2capella +git clone --recurse-submodules https://github.com/DSD-DBS/capella-ros-tools +cd capella-ros-tools python -m venv .venv source .venv/bin/activate.sh # for Linux / Mac diff --git a/rosidl2capella/__init__.py b/capella_ros_tools/__init__.py similarity index 70% rename from rosidl2capella/__init__.py rename to capella_ros_tools/__init__.py index e02b53b..ef599ea 100644 --- a/rosidl2capella/__init__.py +++ b/capella_ros_tools/__init__.py @@ -1,10 +1,10 @@ # Copyright DB Netz AG and contributors # SPDX-License-Identifier: Apache-2.0 -"""The rosidl2capella package.""" +"""The capella-ros-tools package.""" from importlib import metadata try: - __version__ = metadata.version("rosidl2capella") + __version__ = metadata.version("capella-ros-tools") except metadata.PackageNotFoundError: # pragma: no cover __version__ = "0.0.0+unknown" del metadata diff --git a/capella_ros_tools/__main__.py b/capella_ros_tools/__main__.py new file mode 100644 index 0000000..2c78dbd --- /dev/null +++ b/capella_ros_tools/__main__.py @@ -0,0 +1,24 @@ +# Copyright DB Netz AG and contributors +# SPDX-License-Identifier: Apache-2.0 +"""Main entry point into capella-ros-tools.""" +import click + +import capella_ros_tools +from capella_ros_tools.msg2capella import msg2capella + +# from capella_ros_tools.capella2msg import capella2msg + + +@click.command() +@click.version_option( + version=capella_ros_tools.__version__, + prog_name="capella-ros-tools", + message="%(prog)s %(version)s", +) +def main(): + """Console script for capella-ros-tools.""" + + +if __name__ == "__main__": + msg2capella() + # capella2msg() diff --git a/rosidl2capella/capella2msg.py b/capella_ros_tools/capella2msg.py similarity index 90% rename from rosidl2capella/capella2msg.py rename to capella_ros_tools/capella2msg.py index 57b0547..f176d9a 100644 --- a/rosidl2capella/capella2msg.py +++ b/capella_ros_tools/capella2msg.py @@ -6,10 +6,10 @@ import click -import rosidl2capella -from rosidl2capella.modules import BASIC_TYPES, ROS_INTERFACES -from rosidl2capella.modules.parse_capella import ParseCapella -from rosidl2capella.modules.serialize_message import ( +import capella_ros_tools +from capella_ros_tools.modules import BASIC_TYPES, ROS_INTERFACES +from capella_ros_tools.modules.parse_capella import ParseCapella +from capella_ros_tools.modules.serialize_message import ( SerializeMessageDef, SerializeMessagesPkg, ) @@ -42,8 +42,8 @@ def add_package(self, current_root): @click.command() @click.version_option( - version=rosidl2capella.__version__, - prog_name="rosidl2capella", + version=capella_ros_tools.__version__, + prog_name="capella-ros-tools", message="%(prog)s %(version)s", ) @click.argument( diff --git a/rosidl2capella/modules/__init__.py b/capella_ros_tools/modules/__init__.py similarity index 100% rename from rosidl2capella/modules/__init__.py rename to capella_ros_tools/modules/__init__.py diff --git a/rosidl2capella/modules/parse_capella.py b/capella_ros_tools/modules/parse_capella.py similarity index 100% rename from rosidl2capella/modules/parse_capella.py rename to capella_ros_tools/modules/parse_capella.py diff --git a/rosidl2capella/modules/parse_message.py b/capella_ros_tools/modules/parse_message.py similarity index 100% rename from rosidl2capella/modules/parse_message.py rename to capella_ros_tools/modules/parse_message.py diff --git a/rosidl2capella/modules/serialize_capella.py b/capella_ros_tools/modules/serialize_capella.py similarity index 100% rename from rosidl2capella/modules/serialize_capella.py rename to capella_ros_tools/modules/serialize_capella.py diff --git a/rosidl2capella/modules/serialize_message.py b/capella_ros_tools/modules/serialize_message.py similarity index 100% rename from rosidl2capella/modules/serialize_message.py rename to capella_ros_tools/modules/serialize_message.py diff --git a/rosidl2capella/msg2capella.py b/capella_ros_tools/msg2capella.py similarity index 93% rename from rosidl2capella/msg2capella.py rename to capella_ros_tools/msg2capella.py index a0937f0..2fefbb2 100644 --- a/rosidl2capella/msg2capella.py +++ b/capella_ros_tools/msg2capella.py @@ -6,10 +6,10 @@ import click -import rosidl2capella -from rosidl2capella.modules import ROS_INTERFACES -from rosidl2capella.modules.parse_message import ParseMessagesPkg -from rosidl2capella.modules.serialize_capella import SerializeCapella +import capella_ros_tools +from capella_ros_tools.modules import ROS_INTERFACES +from capella_ros_tools.modules.parse_message import ParseMessagesPkg +from capella_ros_tools.modules.serialize_capella import SerializeCapella class Msg2Capella: @@ -77,8 +77,8 @@ def add_relations(self, messages, packages, current_root): @click.command() @click.version_option( - version=rosidl2capella.__version__, - prog_name="rosidl2capella", + version=capella_ros_tools.__version__, + prog_name="capella-ros-tools", message="%(prog)s %(version)s", ) @click.argument( diff --git a/docs/source/conf.py b/docs/source/conf.py index e3f086b..1925ae0 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -14,7 +14,7 @@ sys.path.insert(0, os.path.abspath("../..")) -import rosidl2capella +import capella_ros_tools # -- Project information ----------------------------------------------------- @@ -25,7 +25,7 @@ with open("../../pyproject.toml", "rb") as f: _metadata = tomllib.load(f)["project"] -project = "rosidl2capella" +project = "capella-ros-tools" author = _metadata["authors"][0]["name"] copyright = f"{author} and the {_metadata['name']} contributors" @@ -58,7 +58,7 @@ # built documents. # The full version, including alpha/beta/rc tags. -version = rosidl2capella.__version__ +version = capella_ros_tools.__version__ rst_epilog = f""" .. |Project| replace:: {project} .. |Version| replace:: {version} @@ -95,7 +95,7 @@ "footer_icons": [ { "name": "GitHub", - "url": "https://github.com/DSD-DBS/rosidl2capella", + "url": "https://github.com/DSD-DBS/capella-ros-tools", "html": '', "class": "", }, diff --git a/docs/source/index.rst b/docs/source/index.rst index 963fdcb..8e45b65 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -2,8 +2,8 @@ Copyright DB Netz AG and contributors SPDX-License-Identifier: Apache-2.0 -Welcome to rosidl2capella's documentation! -========================================== +Welcome to capella-ros-tools's documentation! +============================================= .. toctree:: :maxdepth: 2 diff --git a/pyproject.toml b/pyproject.toml index 4b90cfa..27a0b29 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,10 +8,10 @@ build-backend = "setuptools.build_meta" [project] dynamic = ["version"] -name = "rosidl2capella" -description = "Tool for parsing ROS IDL (.msg files) and converting them to Capella model." +name = "capella-ros-tools" +description = "Tools for using ROS with Capella" readme = "README.md" -requires-python = ">=3, <3.11" +requires-python = ">=3.10, <3.12" license = { text = "Apache-2.0" } authors = [ { name = "DB Netz AG" }, @@ -24,15 +24,15 @@ classifiers = [ "Operating System :: OS Independent", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.10", -] + ] dependencies = [ "click", "capellambse @ git+https://github.com/DSD-DBS/py-capellambse.git@roletag-create", ] [project.urls] -Homepage = "https://github.com/DSD-DBS/rosidl2capella" -Documentation = "https://dsd-dbs.github.io/rosidl2capella" +Homepage = "https://github.com/DSD-DBS/capella-ros-tools" +Documentation = "https://dsd-dbs.github.io/capella-ros-tools" [project.optional-dependencies] docs = [ @@ -54,7 +54,7 @@ target-version = ["py310"] [tool.coverage.run] branch = true command_line = "-m pytest" -source = ["rosidl2capella"] +source = ["capella_ros_tools"] [tool.coverage.report] exclude_also = [ @@ -195,7 +195,7 @@ zip-safe = false "*" = ["py.typed"] [tool.setuptools.packages.find] -include = ["rosidl2capella", "rosidl2capella.*"] +include = ["capella_ros_tools", "capella_ros_tools.*"] [tool.setuptools_scm] # This section must exist for setuptools_scm to work diff --git a/rosidl2capella/__main__.py b/rosidl2capella/__main__.py deleted file mode 100644 index 20331d1..0000000 --- a/rosidl2capella/__main__.py +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright DB Netz AG and contributors -# SPDX-License-Identifier: Apache-2.0 -"""Main entry point into rosidl2capella.""" -import click - -import rosidl2capella -from rosidl2capella.capella2msg import capella2msg - -# from rosidl2capella.msg2capella import msg2capella - - -@click.command() -@click.version_option( - version=rosidl2capella.__version__, - prog_name="rosidl2capella", - message="%(prog)s %(version)s", -) -def main(): - """Console script for rosidl2capella.""" - - -if __name__ == "__main__": - # msg2capella() - capella2msg() diff --git a/tests/test_rosidl2capella.py b/tests/test_rosidl2capella.py index 55b31ae..17bcb5d 100644 --- a/tests/test_rosidl2capella.py +++ b/tests/test_rosidl2capella.py @@ -1,7 +1,7 @@ # Copyright DB Netz AG and contributors # SPDX-License-Identifier: Apache-2.0 -import rosidl2capella +import capella_ros_tools def test_add_some_tests_here():