Closed siemdejong closed 1 year ago
import sys
SCRIPT_DIR = Path(__file__).absolute().parent
sys.path.append(str(SCRIPT_DIR.parent))
is needed, but I prefer to not append the directory to the python path. Not good practice for a pypi package.
pip install -e .
to install the development version.
relative imports with package.module
.
Describe the bug
import shithappens.sort_situations
imports from a pip installed version, but during development, it is useful to let it do relative imports from a local tree.To Reproduce Steps to reproduce the behavior:
Expected behavior No
ModuleNotFoundError
given.Additional context Is a possible solution to use
importlib.resources
?