Skip to content

Commit

Permalink
Merge branch 'main' into pv/fix-sortby-typing
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Varner committed May 26, 2022
2 parents 128e861 + 28adaf1 commit 4d5b1dc
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions pystac_client/item_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@
r"(?P<remainder>(T|t)\d{2}:\d{2}:\d{2}(\.\d+)?"
r"(?P<tz_info>Z|([-+])(\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]]
Expand All @@ -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]]
Expand Down
4 changes: 4 additions & 0 deletions tests/test_item_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 4d5b1dc

Please sign in to comment.