micropython / micropython/micropython
Look for modules in every directory of `usys.path`
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 22.1k
- Forks
- 9k
- Avg merge
- 6d 4h
- Merged PRs (30d)
- 16
Description
Current behavior: if usys.path==["/lib",".flash"] and there's a /lib/foo/ directory, import foo.bar will fail even though help("modules") does list it and .flashstill is inusys.path`.
This is a problem because when I write and debug large programs which don't fit into RAM, I often want to deploy new versions of single modules without disrupting everything else. Right now I have to re-flash the whole board just to add one print() line somewhere. This also raises concerns about the number of write cycles.
Proposed fix: teach MicroPython to check all elements of usys.path for the relevant file-or-directory, instead of stopping at the first one it finds.
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 with the import foo.bar lookup behavior and how usys.path is searched when it contains ["/lib",".flash"]. Reproduce the case with /lib/foo/ and a module in .flash; done means relevant files or directories are found across every usys.path element without requiring a full re-flash.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, python
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100