Skip to content
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

pytest satpy/tests does not work #1829

Closed
sahar-github opened this issue Sep 21, 2021 · 8 comments · Fixed by #1830
Closed

pytest satpy/tests does not work #1829

sahar-github opened this issue Sep 21, 2021 · 8 comments · Fixed by #1830

Comments

@sahar-github
Copy link

Describe the bug/error
Import error while loading conftest
could you please guide me how should i resolve this issue?
Thanks

Actual results
Import error while loading conftest
satpy/--init--.py:21: in module
from satpy.version import version as --version--
module not found: no module named satpy.version

@mraspaud
Copy link
Member

Hi, could you tell us how you installed satpy?

@sahar-github
Copy link
Author

sahar-github commented Sep 21, 2021 via email

@djhoese
Copy link
Member

djhoese commented Sep 21, 2021

Can you try the pip install -e . part again and make sure it succeeds? The version.py module is created when Satpy is first installed. If it isn't properly installed that module won't be created and you get this error.

@sahar-github
Copy link
Author

thanks for your suggestion! It is successfully installed
It seems the first issue was that I had two satpy folders instead of one, so I had to run the test via satpy/satpy/tests
but now I have several other errors raising, please see the attached screenshot
errors_testSatpy2

@djhoese
Copy link
Member

djhoese commented Sep 21, 2021

Some of these are optional dependencies. Unless you plan on doing development on the things being tested in these failing tests I personally wouldn't worry about it. You can find the full list of dependencies needed to run all tests here:

satpy/setup.py

Lines 38 to 40 in a6f26f3

test_requires = ['behave', 'h5py', 'netCDF4', 'pyhdf', 'imageio', 'libtiff',
'rasterio', 'geoviews', 'trollimage', 'fsspec', 'bottleneck',
'rioxarray', 'pytest', 'pytest-lazy-fixture']

I'm realizing though that there isn't an easy way to install these dependencies except to do it manually. I'll make a pull request for that. Regardless, what are you hoping to work on? I wouldn't worry about running all the Satpy tests unless you plan on doing large changes to the library. Each reader and writer has their own dependencies so installing all of them can get annoying (especially the C-based compile ones).

Hope this clears some stuff up. I'll work on making this easier in a new PR this morning and documenting it better.

@sahar-github
Copy link
Author

Thanks for the declaration. I would like to add a new reader to satpy, and for that I do not require dependencies of MODIS. Then I can just ignore the errors right?

@djhoese
Copy link
Member

djhoese commented Sep 22, 2021

Yes, I think they can be ignored. Or you could install the extra dependencies yourself and then the tests would pass. It is up to you.

I'm going to consider this issue closed as I think we've addressed the primary issue (missing dependencies).

@djhoese djhoese closed this as completed Sep 22, 2021
@sahar-github
Copy link
Author

sahar-github commented Sep 23, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants