__init__.py is empty when uing colcon build and generate_parameter_library
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- build-system
Research direction
Start with the package's setup.py and trace what generate_parameter_module() does during a regular colcon build (without --symlink-install). Reproduce the issue using the steps in the report and inspect the installed my_package/__init__.py; the fix should preserve its contents in the installed package.
Written by the indexing model from the issue text.
Description
When building with colcon build instead of colcon build --symlink-install, the init.py in the install folder is empty, even if originally it was not. If it is done with symlink, no problems arise, as it uses the init.py directly from the src folder.
To reproduce the issue with ros2 jazzy:
- create a package:
ros2 pkg create --build-type ament_python --license Apache-2.0 my_package - add the following lines to
__init__.pyin~/colcon_ws/src/my_package/my_package:
print("Hello World")
- create a config folder and place a yaml in there (for the parameter library):
config/my_package_parameters.yaml:
my_package:
base_footprint_frame:
type: string
default_value: base_footprint
description: 'The frame of the robot base'
read_only: true
- In the
setup.pyadd the following:
import glob
generate_parameter_module(
"my_package_parameters", # python module name for parameter library
"config/my_package_parameters.yaml", # path to input yaml file
)
package_name = 'my_package'
setup(
name=package_name,
version='0.0.0',
packages=find_packages(exclude=['test']),
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + package_name, ['package.xml']),
("share/" + package_name + "/config", glob.glob("config/*.yaml")),
],
install_requires=['setuptools'],
- Now delete build install log directories first and then build with `colcon build --packages-select my_package
- Then when doing
cat install/my_package/lib/python3.12/site-packages/my_package/__init__.py, it should show an empty file. If we do not perform the generate_parameter_module() method, it is not empty.
- Dominant language
- Python
- Stars
- 385
- Forks
- 81
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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.
More from PickNikRobotics/generate_parameter_library
-
Add ament_cmake_python install instructions to READMEPossibly taken @tylerjw claimed this today. Opendocumentation
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
PickNikRobotics/generate_parameter_library#392 · 2 comments ·
-
GCC 15 emits -Wfree-nonheap-object for generated string one_of validationPossibly taken @tylerjw claimed this 17 days ago. Open
PickNikRobotics/generate_parameter_library#389 · 1 comment · 1 assignee ·
-
Feature request: math in the yamlPossibly taken @tylerjw claimed this 17 days ago. Open
PickNikRobotics/generate_parameter_library#381 · 2 comments · 1 reaction · 1 assignee ·
-
Validator reference (bounds<>/element_bounds<> etc.) is hard to find inside the READMEPossibly taken @tylerjw claimed this 17 days ago. Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
PickNikRobotics/generate_parameter_library#377 · 1 comment ·
All issues in PickNikRobotics/generate_parameter_library
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
common-workflow-language/cwl-utils#477 ·
Maintainers usually reply within 1 day
-
Add dependabotOpenfeat
Difficulty 2/5 Under an hour Newbie friendliness 72/100
open-nudge/opentemplate#204 ·
Maintainers usually reply within 1 day
-
github-stale-ci-pr-closer: KV state is double-wrapped, never persists, and hits the depth-32 limitPossibly taken @VascoSch92 claimed this today. Openpriority:medium ready-for-dev
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
OpenHands/extensions#781 ·
Maintainers usually reply within 1 day
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
curriculum documentation quality
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
githubnext/gh-aw-workshop#4638 ·
Maintainers usually reply within 1 day