Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

__init__.py is empty when uing colcon build and generate_parameter_library

Aperta
#255 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

@MarqRazz ci sta già lavorando.

Dal 7/10/2026.

  • #393 di @MarqRazz — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python
Ambito
build-system

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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__.py in ~/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.py add 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.
Lingua principale
Python
Stelle
385
Fork
81
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PickNikRobotics/generate_parameter_library

Tutte le issue di PickNikRobotics/generate_parameter_library

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.