M
Modular15mo ago
sa-code

Is there an equivalent of PYTHONPATH? I would like to separate my test directory

I would like to setup my folder structure like this:
.
├── LICENSE
├── src
│ └── arrow.mojo
└── test
└── test.mojo

2 directories, 3 files
.
├── LICENSE
├── src
│ └── arrow.mojo
└── test
└── test.mojo

2 directories, 3 files
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
EddTests
EddTests15mo ago
Have you added __init__.mojo files into the src dir?
sa-code
sa-codeOP15mo ago
Yup, and that gives the same error 😦
ModularBot
ModularBot15mo ago
Congrats @sa-code, you just advanced to level 6!
guidorice
guidorice15mo ago
@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
sa-code
sa-codeOP15mo ago
thanks! That's what I'm doing too I suppose that's our life for now
Want results from more Discord servers?
Add your server