Git Product home page Git Product logo

ros2_setup's Introduction

Ros2Setup

This project is a tiny python library made for ROS2 modules to simplify the packaging process.
Instead of having two files -setup.py and package.xml- with the same duplicated information, this module makes it easy dynamically import the information from the package.xml into the python setup file.

This way, only the package.xml file has to be edited, to prevent having the two files with conflicting information.

Installing

Either install with pip install ros2setup, or copy ros2setup.py next to your setup.py so that it is accessible from there.

Usage

In the setup.py file of your ROS2 package, change the hardcoded information to a call to Ros2Setup to pull the data from the XML file.

from setuptools import setup
from ros2setup import Ros2Setup

package_name = Ros2Setup.tag('name')
setup(
    name=package_name,
    version=Ros2Setup.tag('version'),
    packages=[package_name],
    data_files=[
        ('share/ament_index/resource_index/packages',
            ['resource/' + package_name]),
        ('share/' + package_name, ['package.xml']),
    ],
    install_requires=['setuptools'],
    zip_safe=True,
    maintainer=Ros2Setup.tag('maintainer'),
    maintainer_email=Ros2Setup.attrib('maintainer', 'email'),
    description=Ros2Setup.tag('description'),
    license=Ros2Setup.tag('license'),
    tests_require=['pytest'],
    entry_points={
        'console_scripts': [
            'streamer = mypackage.submodule:main',
        ],
    },
)

ros2_setup's People

Contributors

frederic98 avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.