Skip to content
This repository has been archived by the owner on Apr 14, 2022. It is now read-only.

Better handle imports from modules run as scripts #1602

Open
jakebailey opened this issue Sep 30, 2019 · 0 comments
Open

Better handle imports from modules run as scripts #1602

jakebailey opened this issue Sep 30, 2019 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@jakebailey
Copy link
Member

Right now, our import system is "global", shared from every module. However, when a file is run as a script, say python foo/bar.py, then its sys.path is prepended with the directory in which the script lives, and its effective import root is there.

We can't handle this case, and require extraPaths or PYTHONPATH in order to set an extra import root for this scenario.

In order to better handle this case, we could have some setup to have import roots per-module, but doing so would require #443/#846/#1360/etc to be fixed in order to decouple importable names from the identity of a module.

Going through some issues:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant