Relative upper-level imports are improperly linked [python]
See original GitHub issueConsider this code:
from ..models.alphaname import Alphaname
from ..forms.alphaname import AlphanameForm
from ..tasks import submitAlphanameInstantly
Module Linker creates references to:
- https://bitbucket.org/neithere/pymodels/
- https://pypi.python.org/pypi/forms
- https://github.com/stevepeak/tasks-cli
instead of referring upper-level packages/modules.
However it successfully recognises same-package imports, like:
from .models.campaign import Campaign
from .models.task import Task
from .models.alphaname import Alphaname
from .models.message import Message
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
beyond top level package error in relative import
This is behavior since Python 2 when packages did not yet exist. Making the running directory a package would allow imports of modules...
Read more >What's wrong with relative imports in Python?
The problem of import icing is that you don't know whether it's an absolute import or a relative import. icing could be a...
Read more >Proper way of organizing code into subpackages - New to Julia
Hi all, I am in the process of converting a fairly complicated proprietary simulation model that I wrote in Python to Julia 1.5.3....
Read more >Kaitai Struct User Guide
But sometimes we need just the opposite: how do we access upper-level elements from lower-level types? Kaitai Struct provides two options here: ...
Read more >Absolute vs Relative Imports in Python
Syntax and Practical Examples; Pros and Cons of Relative Imports ... Watch Now This tutorial has a related video course created by the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Also, this https://github.com/fiatjaf/module-linker/blob/d8e2601/languages/python.js#L36-L39 condition looks invalid: it’s never true, the code checks that the string is both empty and starts with a dot.
Same issue with nix, see https://github.com/shlevy/nix-adt/blob/dd04b5d08eed65ecd73aafde56a78078e09f1c74/source-example.nix#L94