I'm creating my first package and I can not figure out how to create a simple test.py
file to debug my code.
Consider the following file structure.
|--MyPackage
|--test.py
|--PackageName
|--__init__.py
|--module.py
Inside test.py
I have: from .src.module import SomeClass
And of course this gives me the dreaded "attempted relative import with no known parent package" message.
I know I could just install the package and then import it with from PackageName.module import SomeClass
but then I'm using the code installed on my system and not the code that I am actively editing.
There has got to be some kind of standard way for testing and debugging a package right? Despite all the searching I've done, I can't seem to find any kind of solution.
I'm running test.py
with python3 test.py
If it's helpful, here is a screenshot of my actual project folder structure: