Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building helloworld package fails #584

Closed
SilvioMueller opened this issue Sep 12, 2023 · 4 comments
Closed

Building helloworld package fails #584

SilvioMueller opened this issue Sep 12, 2023 · 4 comments

Comments

@SilvioMueller
Copy link

SilvioMueller commented Sep 12, 2023

I am trying to build the basic package created with ros2 pkg create --build-type ament_python helloworld But if I try to build with colcon build I get the follwoing error:

--- stderr: helloworld
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/colcon_core/executor/__init__.py", line 91, in __call__
    rc = await self.task(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/colcon_core/task/__init__.py", line 93, in __call__
    return await task_method(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/colcon_ros/task/ament_python/build.py", line 51, in build
    setup_py_data = get_setup_data(self.context.pkg, env)
  File "/usr/lib/python3/dist-packages/colcon_core/task/python/__init__.py", line 20, in get_setup_data
    return dict(pkg.metadata[key](env))
  File "/usr/lib/python3/dist-packages/colcon_ros/package_augmentation/ros_ament_python.py", line 57, in getter
    return get_setup_information(
  File "/usr/lib/python3/dist-packages/colcon_python_setup_py/package_identification/python_setup_py.py", line 241, in get_setup_information
    _setup_information_cache[hashable_env] = _get_setup_information(
  File "/usr/lib/python3/dist-packages/colcon_python_setup_py/package_identification/python_setup_py.py", line 293, in _get_setup_information
    return ast.literal_eval(output)
  File "/usr/lib/python3.10/ast.py", line 64, in literal_eval
    node_or_string = parse(node_or_string.lstrip(" \t"), mode='eval')
  File "/usr/lib/python3.10/ast.py", line 50, in parse
    return compile(source, filename, mode, flags,
  File "<unknown>", line 1
    {'package_data': {}, 'dist_files': [], 'src_root': None, 'dependency_links': [], 'setup_requires': [], 'eager_resources': None, 'entry_points': {'console_scripts': []}, 'exclude_package_data': None, 'extras_require': {}, 'include_package_data': None, 'install_requires': ['setuptools'], 'namespace_packages': None, 'packages': ['helloworld'], 'python_requires': None, 'test_loader': None, 'test_runner': None, 'test_suite': None, 'tests_require': ['pytest'], 'use_2to3': None, 'zip_safe': True, 'verbose': 1, 'dry_run': 0, 'help': 0, 'command_packages': None, 'script_name': 'setup.py', 'script_args': ['--dry-run'], 'command_options': {'develop': {'script_dir': ('setup.cfg', '$base/lib/helloworld')}, 'install': {'install_scripts': ('setup.cfg', '$base/lib/helloworld')}}, 'package_dir': {}, 'py_modules': None, 'libraries': None, 'headers': None, 'ext_package': None, 'include_dirs': None, 'extra_path': None, 'scripts': None, 'data_files': [('share/ament_index/resource_index/packages', ['resource/helloworld']), ('share/helloworld', ['package.xml'])], 'password': '', 'command_obj': {}, 'have_run': {}, 'want_user_cfg': True, 'metadata': {'name': 'helloworld', 'version': '0.0.0', 'author': None, 'author_email': None, 'maintainer': 'sml', 'maintainer_email': 'sml@todo.todo', 'url': None, 'license': 'TODO: License declaration', 'description': 'TODO: Package description', 'long_description': None, 'keywords': None, 'platforms': None, 'classifiers': None, 'download_url': None, 'provides': None, 'requires': None, 'obsoletes': None, 'long_description_content_type': None, 'project_urls': {}, 'license_file': None, '_normalized_install_requires': {'setuptools': <Requirement('setuptools')>}, '_normalized_extras_require': {}}}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ^
SyntaxError: invalid syntax

This error only happens for python packages. C++ Packages are beeing built.

My System is:

  • Ubuntu 20.04.3
  • ROS2 Humble
  • Python 3.10.12
@asasine
Copy link

asasine commented Sep 12, 2023

We've begun seeing this when building other packages too including ament_cpplint, ament_uncrustify, and ament_lint. The next best issue I could find for this is colcon/colcon-python-setup-py#56

@cottsay
Copy link
Member

cottsay commented Sep 12, 2023

I'm pretty sure this is colcon/colcon-python-setup-py#56. Can you both confirm if pinning setuptools worked around the issue?

@pablogs9 FYI

@asasine
Copy link

asasine commented Sep 12, 2023

I can confirm that upgrading setuptools>68.2.0 mitigates the issue.

@cottsay
Copy link
Member

cottsay commented Sep 12, 2023

Thanks, closing this as a duplicate of colcon/colcon-python-setup-py#56.

@cottsay cottsay closed this as not planned Won't fix, can't repro, duplicate, stale Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants