Import is resolving the wrong module
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start at invoke/loader.py#L77 and reproduce the reported project layout with tasks/common.py and a same-named site-packages module. Trace which module is selected during import, then verify that the external module is resolved instead of tasks/common.py and add coverage for the conflict if the existing test layout identifies a suitable place.
Written by the indexing model from the issue text.
Description
If you have a submodule under tasks that has the same name as a top-level module, the import will fail.
For example, I have a module named common which is located in my site-packages.
My tasks directory looks like:
/project
/tasks
__init__.py
common.py
The issue is pretty simple,
https://github.com/pyinvoke/invoke/blob/main/invoke/loader.py#L77
import common now comes from /project/tasks instead of my site-packages.
- Dominant language
- Python
- Stars
- 4.8k
- Forks
- 412
- PR merge metrics
- No merged PRs in 30d
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.
More from pyinvoke/invoke
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Similar issues
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
simonw/sqlite-utils#872 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100