Is there an equivalent of PYTHONPATH? I would like to separate my test directory
I would like to setup my folder structure like this:
However I can't seem to import
arrow
from test.mojo
unless they are in the same directory. The error is cannot import relative to a top-level package
6 Replies
Have you added
__init__.mojo
files into the src dir?Modular Docs - Mojo modules and packages
Learn how to package Mojo code for distribution and importing.
Yup, and that gives the same error 😦
Congrats @sa-code, you just advanced to level 6!
@sa-code I also have the same question. For now I am just maintaining a tests script within my mojo package. Then in a Makefile at my project root dir, I use the include arg:
mojo run -I . geo_features/test/main.mojo
thanks! That's what I'm doing too
I suppose that's our life for now