From afc12ccf5951a388f71d241637ab0ced4162f9e1 Mon Sep 17 00:00:00 2001 From: Jon Duckworth Date: Wed, 29 Jun 2022 12:28:01 -0400 Subject: [PATCH 1/2] Fix docs for StacIO.read/write_text (#835) * Fix docs for StacIO.read/write_text * Add CHANGELOG entry for #835 --- CHANGELOG.md | 1 + pystac/stac_io.py | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c571200c6..44d073bc4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ - "How to create STAC catalogs" tutorial ([#775](https://github.com/stac-utils/pystac/pull/775)) - Add a `variables` argument, to accompany `dimensions`, for the `apply` method of stac objects extended with datacube ([#782](https://github.com/stac-utils/pystac/pull/782)) - Deepcopy collection properties on clone. Implement `clone` method for `Summaries` ([#794](https://github.com/stac-utils/pystac/pull/794)) +- Docstrings for `StacIO.read_text` and `StacIO.write_text` now match the type annotations for the `source` argument. ([#835](https://github.com/stac-utils/pystac/pull/835)) ## [v1.4.0] diff --git a/pystac/stac_io.py b/pystac/stac_io.py index dd64e1930..6d98fffc7 100644 --- a/pystac/stac_io.py +++ b/pystac/stac_io.py @@ -42,11 +42,11 @@ class StacIO(ABC): def read_text(self, source: HREF, *args: Any, **kwargs: Any) -> str: """Read text from the given URI. - The source to read from can be specified as a string or a - :class:`~pystac.Link`. If it is a string, it must be a URI or local path from - which to read. Using a :class:`~pystac.Link` enables implementations to use - additional link information, such as paging information contained in the - extended links described in the `STAC API spec + The source to read from can be specified as a string or :class:`os.PathLike` + object (:class:`~pystac.Link` is a path-like object). If it is a string, it + must be a URI or local path from which to read. Using a :class:`~pystac.Link` + enables implementations to use additional link information, such as paging + information contained in the extended links described in the `STAC API spec `__. Args: @@ -71,10 +71,11 @@ def write_text( ) -> None: """Write the given text to a file at the given URI. - The destination to write to from can be specified as a string or a - :class:`~pystac.Link`. If it is a string, it must be a URI or local path from - which to read. Using a :class:`~pystac.Link` enables implementations to use - additional link information. + The destination to write to can be specified as a string or + :class:`os.PathLike` object (:class:`~pystac.Link` is a path-like object). If + it is a string, it must be a URI or local path from which to read. Using a + :class:`~pystac.Link` enables implementations to use additional link + information. Args: dest : The destination to write to. From 0c6074a4315af5d592613c7ce3b2e0d0ef6ed16d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 Jun 2022 12:28:55 -0400 Subject: [PATCH 2/2] build(deps): bump types-python-dateutil from 2.8.17 to 2.8.18 (#829) Bumps [types-python-dateutil](https://github.com/python/typeshed) from 2.8.17 to 2.8.18. - [Release notes](https://github.com/python/typeshed/releases) - [Commits](https://github.com/python/typeshed/commits) --- updated-dependencies: - dependency-name: types-python-dateutil dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 49dd59995..0747c6d75 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -8,7 +8,7 @@ jsonschema==4.6.0 coverage==6.4.1 doc8==0.11.2 -types-python-dateutil==2.8.17 +types-python-dateutil==2.8.18 types-orjson==3.6.2 pre-commit==2.19.0