Skip to main content

Python library for the ROS2 module setup

Project description

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',
        ],
    },
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ros2setup-1.1.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

ros2setup-1.1-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file ros2setup-1.1.tar.gz.

File metadata

  • Download URL: ros2setup-1.1.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.0

File hashes

Hashes for ros2setup-1.1.tar.gz
Algorithm Hash digest
SHA256 b53d019332c716ec2e02dd37b9b5782c110fd58a6bbf84b787d13b72fe1ab0fd
MD5 611369e70d28d69f6bdf5f3be15c0810
BLAKE2b-256 64a049a0d15185152058d336c1c8d7ade3011e43cad3f9a21c297c1d37aa2755

See more details on using hashes here.

File details

Details for the file ros2setup-1.1-py3-none-any.whl.

File metadata

  • Download URL: ros2setup-1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.0

File hashes

Hashes for ros2setup-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 839bde217916280ba72f6c063eddbb35355b29d281e808b42beefc14c6d4fc5a
MD5 fe866d12a6c182a16a095161dfca1eb0
BLAKE2b-256 fb87841776784a30d722a83bc6f3d5b565628701326d1b565db8cb4505cd9abc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page