Utility for adding new import paths.
Project description
🐵
importmonkey
An utility for adding new import paths to
make your relative
import
work without hassle.
pip install importmonkey
What does it do?
Here is your repository:
├─ src
│ └─ project
│ ├─ __init__.py
│ └─ module.py
└─ test
└─ test.py
test.py can't find module.py:
ModuleNotFoundError: No module named 'module'
ImportError: attempted relative import with no known parent package
SystemError: Parent module '' not loaded, cannot perform relative import
importmonkey will fix that:
from importmonkey import add_path # In test.py
add_path("../src")
import project
Why?
Sometimes you want a specific repo structure to test and build a package from the same files so you need a relative / sibling / parent import.
Development details
Show details
Linting
importmonkey$ black .
importmonkey$ flake8 src/ test/
Testing
importmonkey$ python test/run_test_suite.py
Building
importmonkey$ python -m build --wheel && rm -rf build/ && rm -rf src/importmonkey.egg-info/
Releasing
coming soon
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for importmonkey-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f0020b832239d9fb765394f8171b71e8c22084be368614dcb93b0a181b44a65 |
|
MD5 | 44c1950392d974049fbee0364a3154ee |
|
BLAKE2b-256 | afece406f7e1c310a6a07cbb2449ca9947544b8b025cf09e428907b5ff2377d0 |