`pkg create --build-type ament_python` should warn about hyphens in pkg-name
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 262
- Forks
- 228
- Avg merge
- 23h 15m
- Merged PRs (30d)
- 12
Description
Bug report
Required Info:
- Operating System:
- Ubuntu 22.04
- Installation type:
- binaries
- Version or commit hash:
- humble
- DDS implementation:
- /
- Client library (if applicable):
- ros2cli
Steps to reproduce issue
cd src
ros2 pkg create --build-type ament_python --license MIT --node-name hello-world hello-world-python-1 # build breaks
ros2 pkg create --build-type ament_python --license MIT --node-name hello_world hello-world-python-2 # build breaks
ros2 pkg create --build-type ament_python --license MIT --node-name hello-world hello_world_python_3 # build breaks
ros2 pkg create --build-type ament_python --license MIT --node-name hello_world hello_world_python_4 # build works
cd ..
colcon build --packages-select hello-world-python-1 # breaks
colcon build --packages-select hello-world-python-2 # breaks
colcon build --packages-select hello_world_python_3 # breaks
colcon build --packages-select hello_world_python_4 # works
Expected behavior
When running ros2 pkg create with --build-type ament_python warn about hyphens in the name / or abort pkg creation.
Actual behavior
No warning
Additional information
Not really a bug of ros2cli but also not really a feature request. I'd expect a warning, thats why I put it as a bug report.
I assume the check can easily be added here.
If there is agreement on that, I can open a PR with it. Please let me know :)
For reference: PEP-8: Package and Module Names
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in ros2pkg/ros2pkg/verb/create.py around the referenced package-creation logic, then reproduce the four commands in the issue to compare hyphenated and underscored names. Done means ament_python package creation clearly warns about or rejects hyphens, with the resulting behavior verified against the reported colcon build cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100