M
Modular3mo ago
sa-code

Importing package in test

Hey - not sure if I'm doing something wrong with my env setup but my tests in my test/ folder can't seem to import from package_name/. My folder structure is
repo/
package_name/
test/
repo/
package_name/
test/
And in my test files I write
from package_name import stuff
from package_name import stuff
LSP always redlines package_name and says unable to locate module. However everything works just fine from the command line when I run mojo test -I . How have you solved this? Link to my repo if you'd like to try it out: https://github.com/mojo-data/arrow.mojo
GitHub
GitHub - mojo-data/arrow.mojo: Apache Arrow in Mojo🔥
Apache Arrow in Mojo🔥. Contribute to mojo-data/arrow.mojo development by creating an account on GitHub.
2 Replies
Brad Larson
Brad Larson3mo ago
There is an open feature request to at least address the need for the -I . import: https://github.com/modularml/mojo/issues/2916 , although the LSP issues wouldn't be covered by that.
GitHub
[Feature Request] Add default path . to mojo test · Issue #2916 · m...
Review Mojo's priorities I have read the roadmap and priorities and I believe this request falls within the priorities. What is your request? Add path . as part of the default list of directori...
sa-code
sa-code3mo ago
Thanks!
Want results from more Discord servers?
Add your server