https://github.com/rickstaa/unknown_type_placeholder_bug_ns
Example repository to demonstrate the `WARNING: Unknown type: placeholder` bug that is thrown in AutoAPI when using it within a ROS package
https://github.com/rickstaa/unknown_type_placeholder_bug_ns
Last synced: 12 months ago
JSON representation
Example repository to demonstrate the `WARNING: Unknown type: placeholder` bug that is thrown in AutoAPI when using it within a ROS package
- Host: GitHub
- URL: https://github.com/rickstaa/unknown_type_placeholder_bug_ns
- Owner: rickstaa
- Created: 2023-06-27T08:04:58.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-27T08:40:50.000Z (almost 3 years ago)
- Last Synced: 2025-01-14T07:24:28.648Z (over 1 year ago)
- Language: Python
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Unknown Type Placeholder bug
This is a simple example repository to demonstrate the `WARNING: Unknown type: placeholder` bug that is thrown in
AutoAPI when using it within a ROS package (see https://github.com/readthedocs/sphinx-autoapi/issues/180).
## Steps to Reproduce
1. Checkout the `bug` branch.
2. Install Python 3.8 (https://docs.python.org/3/).
3. Install the venv python package (i.e. `sudo apt install python3-venv`).
4. Create a new virtual environment using the `--system-site-packages` flag (i.e. `python3 -m venv test_pkg --system-site-packages`).
5. Install the python dependencies (i.e. `pip install -r requirements/doc_requirements.txt`).
6. Build the documentation from within the `docs` folder (i.e. `make html`).
7. Be greeted by the `WARNING: Unknown type: placeholder` bug.
## How to debug autoapi to find the bug
1. Change the `"program": "~/venvs/placeholder_bug/bin/sphinx-build",` in the `.vscode/launch.json` file to point to your virtual environment's `sphinx-build` executable.
2. Put a breakpoint in the `lib/python3.9/site-packages/autoapi/mappers/python/mapper.py` file at line `333` (i.e. `children = {child["name"]: child for child in module["children"]}`).
3. Run the vscode debugger (i.e. `F5`).
4. See that the code overwrites the dictionary entry for a given module, here `test_pkg`, when a module is encountered for the second time.