I have a project with the following layout:
project_root
__init__.py
typing
__init__.py
bset.py (contains a class BSet)
environment
__init__.py
environment.py
from within environment.py I'm trying to import bset.BSet
from ..typing import bset
def do_something():
b = bset.BSet()
When I try to run environment.py (either directly, or under my test runner) I get:
Traceback (most recent call last):
File "environment/environment.py", line 3, in <module>
from ..typing import bset
ValueError: Attempted relative import in non-package
I'd like the whole thing to function as a module ("project_root"), and I thought I had it working but I appear to have made a change that broke it.
What is the correct way to set up the inter-submodule dependencies?