labgrid-project / labgrid-project/labgrid
Imports in imported files only work in the toplevel directory
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 528
- Forks
- 278
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 4
Description
Files imported in the imports statement can not import other files which are also used in import statements if they are not in the same directory as the yaml file.
This is due to how sys.path works, It only points to the directory of the yaml file.
Approaches for fixes:
- Detect directories in the imports statement and add them to
sys.path - figure out why the
importstatement does not usesys.modulesfor resolution and fix it
Contributor guide
No contributing guide indexed for this repository
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 by tracing how the YAML file processes its imports statement and how imported files are resolved through sys.path and sys.modules. Compare the proposed directory-detection and module-resolution approaches, then verify that nested imports work when files are in different directories.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100