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

Update unstable download URL in CI #2527

Merged
merged 3 commits into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
# may break the conda-forge libraries trying to use newer glibc versions
run: |
python -m pip install \
--index-url https://pypi.anaconda.org/scipy-wheels-nightly/simple/ \
--index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple/ \
--trusted-host pypi.anaconda.org \
--no-deps --pre --upgrade \
matplotlib \
Expand Down
13 changes: 9 additions & 4 deletions satpy/tests/reader_tests/gms/test_gms5_vissr_l1b.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,19 @@
import xarray as xr
from pyresample.geometry import AreaDefinition

import satpy.readers.gms.gms5_vissr_format as fmt
import satpy.readers.gms.gms5_vissr_l1b as vissr
import satpy.readers.gms.gms5_vissr_navigation as nav
import satpy.tests.reader_tests.gms.test_gms5_vissr_data as real_world
from satpy.readers import FSFile
from satpy.tests.reader_tests.utils import get_jit_methods
from satpy.tests.reader_tests.utils import get_jit_methods, skip_numba_unstable_if_missing
from satpy.tests.utils import make_dataid

try:
import satpy.readers.gms.gms5_vissr_format as fmt
import satpy.readers.gms.gms5_vissr_l1b as vissr
import satpy.readers.gms.gms5_vissr_navigation as nav
except ImportError:
if skip_numba_unstable_if_missing():
pytest.skip("Numba is not compatible with unstable NumPy", allow_module_level=True)

Check warning on line 23 in satpy/tests/reader_tests/gms/test_gms5_vissr_l1b.py

View check run for this annotation

Codecov / codecov/patch

satpy/tests/reader_tests/gms/test_gms5_vissr_l1b.py#L21-L23

Added lines #L21 - L23 were not covered by tests

djhoese marked this conversation as resolved.
Show resolved Hide resolved

@pytest.fixture(params=[False, True], autouse=True)
def disable_jit(request, monkeypatch):
Expand Down
9 changes: 7 additions & 2 deletions satpy/tests/reader_tests/gms/test_gms5_vissr_navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
import numpy as np
import pytest

import satpy.readers.gms.gms5_vissr_navigation as nav
from satpy.tests.reader_tests.utils import get_jit_methods
from satpy.tests.reader_tests.utils import get_jit_methods, skip_numba_unstable_if_missing

try:
import satpy.readers.gms.gms5_vissr_navigation as nav
except ImportError:
if skip_numba_unstable_if_missing():
pytest.skip("Numba is not compatible with unstable NumPy", allow_module_level=True)

Check warning on line 12 in satpy/tests/reader_tests/gms/test_gms5_vissr_navigation.py

View check run for this annotation

Codecov / codecov/patch

satpy/tests/reader_tests/gms/test_gms5_vissr_navigation.py#L10-L12

Added lines #L10 - L12 were not covered by tests

# Navigation references computed with JMA's Msial library (files
# VISSR_19960217_2331_IR1.A.IMG and VISSR_19960217_2331_VIS.A.IMG). The VIS
Expand Down
21 changes: 21 additions & 0 deletions satpy/tests/reader_tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""Utilities for reader tests."""

import inspect
import os


def default_attr_processor(root, attr):
Expand Down Expand Up @@ -61,3 +62,23 @@

def _is_jit_method(obj):
return hasattr(obj, "py_func")


def skip_numba_unstable_if_missing():
"""Determine if numba-based tests should be skipped during unstable CI tests.

If numba fails to import it could be because numba is not compatible with
a newer version of numpy. This is very likely to happen in the
unstable/experimental CI environment. This function returns ``True`` if
numba-based tests should be skipped if ``numba`` could not
be imported *and* we're in the unstable environment. We determine if we're
in this CI environment by looking for the ``UNSTABLE="1"``
environment variable.

"""
try:
import numba
except ImportError:
numba = None

Check warning on line 82 in satpy/tests/reader_tests/utils.py

View check run for this annotation

Codecov / codecov/patch

satpy/tests/reader_tests/utils.py#L79-L82

Added lines #L79 - L82 were not covered by tests

return numba is None and os.environ.get("UNSTABLE", "0") in ("1", "true")

Check warning on line 84 in satpy/tests/reader_tests/utils.py

View check run for this annotation

Codecov / codecov/patch

satpy/tests/reader_tests/utils.py#L84

Added line #L84 was not covered by tests