=======
genmypy
=======
A Python stub generator from genmsg specs
Installation
============
If you use catkin and need CMake support for the ``genmypy`` generator, clone the repository and add it to your catkin workspace.
.. code:: sh
cd /path/to/your/ws
git clone https://github.com/rospypi/genmypy.git
If you don't need the cmake support, you can also install it from `pypi.org <https://pypi.org/>`_:
.. code:: sh
pip install genmypy
Usage
=====
catkin
------
Add ``genmypy`` along with ``message_generation`` to ``find_package`` in
CMakeLists.txt. ``genmsg`` will find ``genmypy`` automatically when
building msg/srv files.
Also, keep in mind that your package should have the build dependency
for ``genmypy`` in ``package.xml`` to make sure that catkin finishes the
build of ``genmypy`` before building your package.
Examples:
- CMakeLists.txt
.. code:: cmake
find_package(catkin REQUIRED COMPONENTS std_msgs message_generation genmypy)
- package.xml
.. code:: xml
<build_depend>genmypy</build_depend>
CLI
---
::
$ genmypy --help
Usage: genmypy [-h] {msg,srv,module} ...
positional arguments:
{msg,srv,module}
msg Generate stub files from .msg files
srv Generate stub files from .srv files
module Generate __init__.pyi from a msg/srv directory
optional arguments:
-h, --help show this help message and exit
Examples:
~~~~~~~~~
.. code:: sh
# Message files
$ genmypy msg custom_msgs custom_msgs/msg/Custom.msg
$ genmypy msg std_msgs --out-dir out /opt/ros/noetic/share/std_msgs/msg/Header.msg
$ genmypy msg sensor_msgs --out-dir out \
-Istd_msgs:/opt/ros/noetic/share/std_msgs/msg \
-Isensor_msgs:/opt/ros/noetic/share/sensor_msgs/msg \
/opt/ros/noetic/share/sensor_msgs/msg/PointCloud2.msg
# Service files
$ genmypy srv custom_msgs custom_msgs/srv/Custom.msg
$ genmypy srv nav_msgs --out-dir out \
-Istd_msgs:/opt/ros/noetic/share/std_msgs/msg \
-Isensor_msgs:/opt/ros/noetic/share/sensor_msgs/msg \
/opt/ros/noetic/share/sensor_msgs/srv/SetCameraInfo.srv
# Module files
$ genmypy module custom_msgs/msg
$ genmypy module --module-finder py --out out \
/opt/ros/noetic/lib/python2.7/dist-packages/std_msgs/msg/
``genmypy msg`` / ``genmypy srv``:
.. code:: sh
Usage: genmypy {msg,srv} [-h] [--out-dir OUT_DIR]
[--include-path INCLUDE_PATH]
package files [files ...]
positional arguments:
package Package name of given files
files Files to generate stubs
optional arguments:
-h, --help show this help message and exit
--out-dir OUT_DIR Output directory. If the option is unset, each stub
file will be generated in the same directory as each
input.
--include-path INCLUDE_PATH, -I INCLUDE_PATH
Include paths for processing given files
``genmypy module``:
.. code:: sh
Usage: genmypy module [-h] [--out-dir OUT_DIR] package_dir
Positional arguments:
package_dir Package directory to create __init__.pyi
Optional arguments:
-h, --help show this help message and exit
--out-dir OUT_DIR Output directory. If the option is unset, __init__.pyi
will be generated in the same directory as package_dir.
Raw data
{
"_id": null,
"home_page": "https://github.com/rospypi/genmypy",
"name": "genmypy",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Yuki Igarashi, Tamamki Nishino",
"author_email": "me@bonprosoft.com, otamachan@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/7d/95/08bce4dcc659952a9e48b4efff67ef24b8cbc05d119be50626446d2cc24b/genmypy-0.3.2.tar.gz",
"platform": null,
"description": "=======\ngenmypy\n=======\n\nA Python stub generator from genmsg specs\n\nInstallation\n============\n\nIf you use catkin and need CMake support for the ``genmypy`` generator, clone the repository and add it to your catkin workspace.\n\n.. code:: sh\n\n cd /path/to/your/ws\n git clone https://github.com/rospypi/genmypy.git\n\n\nIf you don't need the cmake support, you can also install it from `pypi.org <https://pypi.org/>`_:\n\n.. code:: sh\n\n pip install genmypy\n\nUsage\n=====\n\ncatkin\n------\n\nAdd ``genmypy`` along with ``message_generation`` to ``find_package`` in\nCMakeLists.txt. ``genmsg`` will find ``genmypy`` automatically when\nbuilding msg/srv files.\n\nAlso, keep in mind that your package should have the build dependency\nfor ``genmypy`` in ``package.xml`` to make sure that catkin finishes the\nbuild of ``genmypy`` before building your package.\n\nExamples:\n\n- CMakeLists.txt\n .. code:: cmake\n\n find_package(catkin REQUIRED COMPONENTS std_msgs message_generation genmypy)\n- package.xml\n .. code:: xml\n\n <build_depend>genmypy</build_depend>\n\nCLI\n---\n\n::\n\n $ genmypy --help\n Usage: genmypy [-h] {msg,srv,module} ...\n positional arguments:\n {msg,srv,module}\n msg Generate stub files from .msg files\n srv Generate stub files from .srv files\n module Generate __init__.pyi from a msg/srv directory\n\n optional arguments:\n -h, --help show this help message and exit\n\nExamples:\n~~~~~~~~~\n\n.. code:: sh\n\n # Message files\n $ genmypy msg custom_msgs custom_msgs/msg/Custom.msg\n $ genmypy msg std_msgs --out-dir out /opt/ros/noetic/share/std_msgs/msg/Header.msg\n $ genmypy msg sensor_msgs --out-dir out \\\n -Istd_msgs:/opt/ros/noetic/share/std_msgs/msg \\\n -Isensor_msgs:/opt/ros/noetic/share/sensor_msgs/msg \\\n /opt/ros/noetic/share/sensor_msgs/msg/PointCloud2.msg\n\n # Service files\n $ genmypy srv custom_msgs custom_msgs/srv/Custom.msg\n $ genmypy srv nav_msgs --out-dir out \\\n -Istd_msgs:/opt/ros/noetic/share/std_msgs/msg \\\n -Isensor_msgs:/opt/ros/noetic/share/sensor_msgs/msg \\\n /opt/ros/noetic/share/sensor_msgs/srv/SetCameraInfo.srv\n\n # Module files\n $ genmypy module custom_msgs/msg\n $ genmypy module --module-finder py --out out \\\n /opt/ros/noetic/lib/python2.7/dist-packages/std_msgs/msg/\n\n``genmypy msg`` / ``genmypy srv``:\n\n.. code:: sh\n\n Usage: genmypy {msg,srv} [-h] [--out-dir OUT_DIR]\n [--include-path INCLUDE_PATH]\n package files [files ...]\n\n positional arguments:\n package Package name of given files\n files Files to generate stubs\n\n optional arguments:\n -h, --help show this help message and exit\n --out-dir OUT_DIR Output directory. If the option is unset, each stub\n file will be generated in the same directory as each\n input.\n --include-path INCLUDE_PATH, -I INCLUDE_PATH\n Include paths for processing given files\n\n``genmypy module``:\n\n.. code:: sh\n\n Usage: genmypy module [-h] [--out-dir OUT_DIR] package_dir\n\n Positional arguments:\n package_dir Package directory to create __init__.pyi\n\n Optional arguments:\n -h, --help show this help message and exit\n --out-dir OUT_DIR Output directory. If the option is unset, __init__.pyi\n will be generated in the same directory as package_dir.\n\n\n",
"bugtrack_url": null,
"license": "Apache License 2.0",
"summary": "A Python stub generator from genmsg specs",
"version": "0.3.2",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c0faf1cf175a0ec9f42c05e0d48d93a2a0eed4be31a3815582a0812170c46dc5",
"md5": "3bf43c0a52e6f345e852740ce22e1423",
"sha256": "083cfd3df4a57f829f60cc6a56b56bac32220832b2f8cea6afbc3d145a943707"
},
"downloads": -1,
"filename": "genmypy-0.3.2-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "3bf43c0a52e6f345e852740ce22e1423",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 14842,
"upload_time": "2023-04-08T05:32:12",
"upload_time_iso_8601": "2023-04-08T05:32:12.240823Z",
"url": "https://files.pythonhosted.org/packages/c0/fa/f1cf175a0ec9f42c05e0d48d93a2a0eed4be31a3815582a0812170c46dc5/genmypy-0.3.2-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7d9508bce4dcc659952a9e48b4efff67ef24b8cbc05d119be50626446d2cc24b",
"md5": "62c7d7e6c22dc1e83f11bc40e63de6ec",
"sha256": "576ea0c16c3de4705c66f1a8d2f48539569abbe27b976032a2956e2f3f270f9c"
},
"downloads": -1,
"filename": "genmypy-0.3.2.tar.gz",
"has_sig": false,
"md5_digest": "62c7d7e6c22dc1e83f11bc40e63de6ec",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14684,
"upload_time": "2023-04-08T05:32:14",
"upload_time_iso_8601": "2023-04-08T05:32:14.860638Z",
"url": "https://files.pythonhosted.org/packages/7d/95/08bce4dcc659952a9e48b4efff67ef24b8cbc05d119be50626446d2cc24b/genmypy-0.3.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-04-08 05:32:14",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "rospypi",
"github_project": "genmypy",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "genmypy"
}