From b92bbb9b17d2e3204ccdd1c7102026b3d46aff29 Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Tue, 15 Nov 2022 06:58:17 -0700 Subject: [PATCH 1/3] feat: remove python 3.7 support Enables our GeoInterface protocol. --- .github/workflows/continuous-integration.yml | 1 - docs/index.rst | 2 +- pystac_client/item_search.py | 14 ++++++++------ setup.py | 3 +-- tests/test_item_search.py | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index d8e1bfa8..37faef29 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -14,7 +14,6 @@ jobs: fail-fast: false matrix: python-version: - - "3.7" - "3.8" - "3.9" - "3.10" diff --git a/docs/index.rst b/docs/index.rst index 857202c1..a884d9fd 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -35,7 +35,7 @@ Installation $ pip install pystac-client -``pystac_client`` requires `Python >=3.7 `__. +``pystac_client`` requires `Python >=3.8 `__. This will install the dependencies :doc:`PySTAC `, :doc:`python-dateutil `, and :doc:`requests `. diff --git a/pystac_client/item_search.py b/pystac_client/item_search.py index 4c14370a..1c8f7c29 100644 --- a/pystac_client/item_search.py +++ b/pystac_client/item_search.py @@ -16,6 +16,7 @@ Iterator, List, Optional, + Protocol, Tuple, Union, ) @@ -38,10 +39,12 @@ r"(?PZ|([-+])(\d{2}):(\d{2}))?)?)?)?" ) -# todo: add runtime_checkable when we drop 3.7 support -# class GeoInterface(Protocol): -# def __geo_interface__(self) -> dict: -# ... + +class GeoInterface(Protocol): + @property + def __geo_interface__(self) -> Dict[str, Any]: + ... + DatetimeOrTimestamp = Optional[Union[datetime_, str]] Datetime = str @@ -62,8 +65,7 @@ IDsLike = Union[IDs, str, List[str], Iterator[str]] Intersects = Dict[str, Any] -IntersectsLike = Union[str, object, Intersects] -# todo: after 3.7 is dropped, replace object with GeoInterface +IntersectsLike = Union[str, GeoInterface, Intersects] Query = Dict[str, Any] QueryLike = Union[Query, List[str]] diff --git a/setup.py b/setup.py index f70d1a49..498da1e1 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ py_modules=[splitext(basename(path))[0] for path in glob("pystac_client/*.py")], include_package_data=True, package_data={"pystac_client": ["py.typed"]}, - python_requires=">=3.7", + python_requires=">=3.8", install_requires=[ "requests>=2.27.1", "pystac>=1.4.0", @@ -43,7 +43,6 @@ classifiers=[ "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/tests/test_item_search.py b/tests/test_item_search.py index fa8038d7..9c2aecde 100644 --- a/tests/test_item_search.py +++ b/tests/test_item_search.py @@ -347,7 +347,7 @@ def test_intersects_json_string(self) -> None: def test_intersects_non_geo_interface_object(self) -> None: with pytest.raises(Exception): - ItemSearch(url=SEARCH_URL, intersects=object()) + ItemSearch(url=SEARCH_URL, intersects=object()) # type: ignore def test_filter_lang_default_for_dict(self) -> None: search = ItemSearch(url=SEARCH_URL, filter={}) From e6a7bfc5790a5b7c0f61bc7fefbdb756c438bc89 Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Tue, 15 Nov 2022 07:04:42 -0700 Subject: [PATCH 2/3] chore: add Python 3.11 support --- .github/workflows/continuous-integration.yml | 2 +- setup.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 37faef29..f375b4e7 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -17,7 +17,7 @@ jobs: - "3.8" - "3.9" - "3.10" -# - "3.11-dev" + - "3.11" os: - ubuntu-latest # - windows-latest diff --git a/setup.py b/setup.py index 498da1e1..1a0a58f9 100644 --- a/setup.py +++ b/setup.py @@ -46,6 +46,7 @@ "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Operating System :: OS Independent", "Natural Language :: English", "Development Status :: 3 - Alpha", From d2ff394ce735fab599b4070a553e937361fb0916 Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Tue, 15 Nov 2022 07:06:03 -0700 Subject: [PATCH 3/3] chore: update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1bc4b9a..e0af0dfd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,12 +9,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Added +- Python 3.11 support [#347](https://github.com/stac-utils/pystac-client/pull/347) + ### Changed ### Fixed ### Removed +- Python 3.7 support [#347](https://github.com/stac-utils/pystac-client/pull/347) + ### Deprecated ## [v0.5.1] - 2022-09-19