Skip to content
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 3 commits into from May 3, 2019

Conversation

1 participant
@kernc
Copy link
Contributor

commented May 3, 2019

Fixes #50

Simpler module importing / better namespace package support.

Breaks CLI API: Previously, for modules specified as relative file paths, python module path was the full relative path (../package/module.py → package.module). Now, python module path is the basename only (module).

To improve namespace module support, needed to roll our own iter_modules() because the one from pkgutil doesn't work (pypa/setuptools#83).

kernc added some commits May 3, 2019

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.
REF: Only reload modules when in --http mode
Maybe avoids problems with modules whose importing
has side effects.

@kernc kernc force-pushed the kernc:new_import branch from 947af75 to 0f5f96e May 3, 2019

@kernc kernc referenced this pull request May 3, 2019

Closed

Module loaded more than once? #50

BUG: Don't put non-str in sys.path
Even as documented that other types are ignored [1],
it seemed to break on other versions of Python [2].

[1]: https://docs.python.org/3/library/sys.html#sys.path
[2]: https://travis-ci.org/pdoc3/pdoc/jobs/527591043#L218-L270

@kernc kernc merged commit cbc829b into pdoc3:master May 3, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@kernc kernc deleted the kernc:new_import branch May 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.