diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 9889282e..84985391 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -9,12 +9,21 @@ on: jobs: build: name: build - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: - python-version: ["3.7", "3.8", "3.9"] + python-version: + - "3.7" + - "3.8" + - "3.9" + - "3.10" +# - "3.11-dev" + os: + - ubuntu-latest +# - windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v3 diff --git a/pystac_client/item_search.py b/pystac_client/item_search.py index 9b57b78a..e2d179dd 100644 --- a/pystac_client/item_search.py +++ b/pystac_client/item_search.py @@ -22,11 +22,10 @@ r"(?P(T|t)\d{2}:\d{2}:\d{2}(\.\d+)?" r"(?PZ|([-+])(\d{2}):(\d{2}))?)?)?)?") - -class GeoInterface(Protocol): - def __geo_interface__(self) -> dict: - ... - +# todo: add runtime_checkable when we drop 3.7 support +# class GeoInterface(Protocol): +# def __geo_interface__(self) -> dict: +# ... DatetimeOrTimestamp = Optional[Union[datetime_, str]] Datetime = Union[Tuple[str], Tuple[str, str]] @@ -43,7 +42,8 @@ def __geo_interface__(self) -> dict: IDsLike = Union[IDs, str, List[str], Iterator[str]] Intersects = dict -IntersectsLike = Union[str, Intersects, GeoInterface] +IntersectsLike = Union[str, object, Intersects] +# todo: after 3.7 is dropped, replace object with GeoInterface Query = dict QueryLike = Union[Query, List[str]] diff --git a/tests/test_item_search.py b/tests/test_item_search.py index 49f66aba..a347b1ba 100644 --- a/tests/test_item_search.py +++ b/tests/test_item_search.py @@ -264,6 +264,10 @@ def test_intersects_non_geo_interface_object(self): with pytest.raises(Exception): ItemSearch(url=SEARCH_URL, intersects=object()) + def test_intersects_non_geo_interface_object(self): + with pytest.raises(Exception): + ItemSearch(url=SEARCH_URL, intersects=object()) + def test_filter_lang_default_for_dict(self): search = ItemSearch(url=SEARCH_URL, filter={}) assert search.get_parameters()['filter-lang'] == 'cql2-json'