New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved module importing / support for namespace packages #62
Merged
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
Diff settings
API: New better module import / support for namespace packages
Breaks CLI behavior when modules specified as file paths: Previously full relative path was considered module path, now only the basename is. Thus some tests break.
- Loading branch information...
kernc
committed
May 3, 2019
commit facbb6f46db2475450f8f47fd0e7e59e625b77a0
Verified
This commit was signed with a verified signature.
GPG key ID: E0955D0CB6D501E3
Learn about signing commits
| @@ -0,0 +1,8 @@ | |||
| import sys | |||
|
|
|||
| try: | |||
| sys._pdoc_imported_once_flag | |||
| except AttributeError: | |||
| sys._pdoc_imported_once_flag = True | |||
| else: | |||
| assert False, 'Module _imported_once already imported' | |||
| @@ -0,0 +1,2 @@ | |||
| class C: | |||
| pass | |||
| @@ -0,0 +1,5 @@ | |||
| from a.util import C | |||
|
|
|||
|
|
|||
| class D(C): | |||
| pass | |||
| @@ -0,0 +1 @@ | |||
| __path__ = __import__('pkgutil').extend_path(__path__, __name__) | |||
| @@ -0,0 +1 @@ | |||
| ../../../1/a/a/util.py | |||
| @@ -0,0 +1 @@ | |||
| ../../a/a/__init__.py | |||
| @@ -0,0 +1 @@ | |||
| ../../../1/b/a/main.py | |||
| @@ -0,0 +1 @@ | |||
| __import__('pkg_resources').declare_namespace(__name__) | |||
| @@ -0,0 +1 @@ | |||
| ../../../1/a/a/util.py | |||
| @@ -0,0 +1 @@ | |||
| ../../a/a/__init__.py | |||
| @@ -0,0 +1 @@ | |||
| ../../../1/b/a/main.py | |||
ProTip!
Use n and p to navigate between commits in a pull request.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.