-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests fail: ImportError: attempted relative import with no known parent package #237
Comments
Hi, I don't at all understand how exactly you are running this. openTSNE doesn't use The error you're getting is most likely as a result of the Python paths being setup incorrectly. Without knowing how exactly you're running the tests, what your environment is, and why you're even running the tests in the first place, it's hard for me to make any useful suggestions. |
The make there is because it is run from the ports framework. The complete command that runs tests is also there, it begins with "cd". |
I am unfamiliar with FreeBSD and the ports framework, but from what I can tell, ports is a FreeBSD package manager, and someone has made openTSNE available there as well. I'm very happy to see that! Based on https://cgit.freebsd.org/ports/commit/?id=20e55e0cf2b75fa0988ae31c9814d1b8844a5428 (I'm guessing you're the author of that patch), you want to run the unit tests once the package has finished installing? I'm not entirely sure why this is happening, it could have something to do with Python paths. You may be overwriting the Python path in +TEST_ENV= ${MAKE_ENV} PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR} Another thing that I might try would be to run +TEST_WRKSRC= ${WRKSRC}/tests to +TEST_WRKSRC= ${WRKSRC} I see that the tests weren't run before the patch I've been referring to at all. Obviously, I understand you wanting to run tests on the installed package to make sure everything is working correctly, but why the sudden change now? |
Tests weren't run before. I only added the 'test' target in this recent commit. This line:
allows to run openTSNE without installing it, from the stage directory. Without
And when I install the py39-openTSNE into the system and run pytest from the project's root directory it fails like this:
|
Sorry for the late reply. Is this still an issue or have you managed to track down what the problem was? |
I am closing this due to inactivity, but please feel free to reopen this if the problem persists. |
@pavlin-policar |
Version: 0.7.1
Python-3.9
FreeBSD 13.1
The text was updated successfully, but these errors were encountered: