Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I solved the problem by renaming the src folder inside packages to have separate names in each package. I renamed the one in pkg_one to be pkg_one_src

Then I changed the tag entry_points to reflect the changes:

entry_points={
      'console_scripts': [
          'pub_one = pkg_one_src.pub_one:main',
       ],
},

Also i made some changes to packages tag:

packages=find_packages(),

to find the python packages automatically

and deleted the py_modules tag.

At the end setup.py looked like this:

from setuptools import find_packages
from setuptools import setup

package_name = 'pkg_one'

setup(
    name=package_name,
    version='0.0.0',
    packages=find_packages(),
    install_requires=['setuptools'],
    zip_safe=True,
    author='user',
    author_email="user@todo.todo",
    maintainer='user',
    maintainer_email="user@todo.todo",
    keywords=['ROS', 'ROS2'],
    classifiers=[
        'Intended Audience :: Developers',
        'License :: OSI Approved :: Apache Software License',
        'Programming Language :: Python',
        'Topic :: Software Development',
    ],
    description='TODO: Package description.',
    license='Apache License, Version 2.0',
    tests_require=['pytest'],
    entry_points={
        'console_scripts': [
            'pub_one = src.pub_one:main',
        ],
    },
)

I solved the problem by renaming the src folder inside packages to have separate names in each package. I renamed the one in pkg_one to be pkg_one_src

Then I changed the tag entry_points in setup.py to reflect the changes:

entry_points={
      'console_scripts': [
          'pub_one = pkg_one_src.pub_one:main',
       ],
},

Also i made some changes to packages tag:

packages=find_packages(),

to find the python packages automatically

and deleted the py_modules tag.

At the end setup.py looked like this:

from setuptools import find_packages
from setuptools import setup

package_name = 'pkg_one'

setup(
    name=package_name,
    version='0.0.0',
    packages=find_packages(),
    install_requires=['setuptools'],
    zip_safe=True,
    author='user',
    author_email="user@todo.todo",
    maintainer='user',
    maintainer_email="user@todo.todo",
    keywords=['ROS', 'ROS2'],
    classifiers=[
        'Intended Audience :: Developers',
        'License :: OSI Approved :: Apache Software License',
        'Programming Language :: Python',
        'Topic :: Software Development',
    ],
    description='TODO: Package description.',
    license='Apache License, Version 2.0',
    tests_require=['pytest'],
    entry_points={
        'console_scripts': [
            'pub_one = src.pub_one:main',
        ],
    },
)

I solved the problem by renaming the src folder inside packages to have separate names in each package. I renamed the one in pkg_one to be pkg_one_src

Then I changed the tag entry_points in setup.py to reflect the changes:

entry_points={
      'console_scripts': [
          'pub_one = pkg_one_src.pub_one:main',
       ],
},

Also i made some changes to packages tag:

packages=find_packages(),

to find the python packages automatically

and deleted the py_modules tag.

At the end setup.py looked like this:

from setuptools import find_packages
from setuptools import setup

package_name = 'pkg_one'

setup(
    name=package_name,
    version='0.0.0',
    packages=find_packages(),
    install_requires=['setuptools'],
    zip_safe=True,
    author='user',
    author_email="user@todo.todo",
    maintainer='user',
    maintainer_email="user@todo.todo",
    keywords=['ROS', 'ROS2'],
    classifiers=[
        'Intended Audience :: Developers',
        'License :: OSI Approved :: Apache Software License',
        'Programming Language :: Python',
        'Topic :: Software Development',
    ],
    description='TODO: Package description.',
    license='Apache License, Version 2.0',
    tests_require=['pytest'],
    entry_points={
        'console_scripts': [
            'pub_one = src.pub_one:main',
pkg_one_src.pub_one:main',
        ],
    },
)

========================== REMARKS ========================================

" Changing your python module name to not be src makes sense. In general your module name should be your package name." - Thanks sloretz for pointing this out!