[Git][debian-gis-team/pystac-client][master] 6 commits: New upstream version 0.8.1

Antonio Valentino (@antonio.valentino) gitlab at salsa.debian.org
Fri May 24 20:38:52 BST 2024



Antonio Valentino pushed to branch master at Debian GIS Project / pystac-client


Commits:
bf0426f6 by Antonio Valentino at 2024-05-24T16:20:17+00:00
New upstream version 0.8.1
- - - - -
b20fdf14 by Antonio Valentino at 2024-05-24T16:20:22+00:00
Update upstream source from tag 'upstream/0.8.1'

Update to upstream version '0.8.1'
with Debian dir 8eab56ef6a488d349f71bbd62b7ef315ed865beb
- - - - -
c02cd74c by Antonio Valentino at 2024-05-24T18:20:34+00:00
New upstream release

- - - - -
29fa3cad by Antonio Valentino at 2024-05-24T18:21:45+00:00
New build-dep on pytest-console-scripts

- - - - -
ddcd3f2b by Antonio Valentino at 2024-05-24T18:21:50+00:00
Do not set proxy for testing

- - - - -
19e179c6 by Antonio Valentino at 2024-05-24T18:21:57+00:00
Set distribution to unstable

- - - - -


11 changed files:

- .pre-commit-config.yaml
- CHANGELOG.md
- debian/changelog
- debian/control
- debian/rules
- docs/index.rst
- pyproject.toml
- pystac_client/item_search.py
- pystac_client/version.py
- + tests/cassettes/test_item_search/test_fields.yaml
- tests/test_item_search.py


Changes:

=====================================
.pre-commit-config.yaml
=====================================
@@ -3,7 +3,7 @@
 
 repos:
   - repo: https://github.com/charliermarsh/ruff-pre-commit
-    rev: "v0.4.4"
+    rev: "v0.4.5"
     hooks:
       - id: ruff
         args: [--fix, --exit-non-zero-on-fix]


=====================================
CHANGELOG.md
=====================================
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
 
 ## [Unreleased]
 
+## [v0.8.1] - 2024-05-23
+
+### Fixed
+
+- Use singular `include` and `exclude` Field extension key names [#690](https://github.com/stac-utils/pystac-client/pull/690)
+
 ## [v0.8.0] - 2024-05-17
 
 ### Fixed
@@ -366,7 +372,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
 
 Initial release.
 
-[Unreleased]: https://github.com/stac-utils/pystac-client/compare/v0.8.0...main
+[Unreleased]: https://github.com/stac-utils/pystac-client/compare/v0.8.1...main
+[v0.8.1]: https://github.com/stac-utils/pystac-client/compare/v0.8.0...v0.8.1
 [v0.8.0]: https://github.com/stac-utils/pystac-client/compare/v0.7.7...v0.8.0
 [v0.7.7]: https://github.com/stac-utils/pystac-client/compare/v0.7.6...v0.7.7
 [v0.7.6]: https://github.com/stac-utils/pystac-client/compare/v0.7.5...v0.7.6


=====================================
debian/changelog
=====================================
@@ -1,3 +1,16 @@
+pystac-client (0.8.1-1) unstable; urgency=medium
+
+  * New upstream release.
+  * debian/control:
+    - New build-dependency on pytest-console-scripts.
+  * debian/rules:
+    - Do not set the https_proxy for testing.
+    - Add --block-network to the pytest parameters.
+    - Re-enable the tests that were previously disabled
+      due to issues with nerwork access.
+
+ -- Antonio Valentino <antonio.valentino at tiscali.it>  Fri, 24 May 2024 16:21:00 +0000
+
 pystac-client (0.8.0-1) unstable; urgency=medium
 
   * New upstream release.


=====================================
debian/control
=====================================
@@ -12,6 +12,7 @@ Build-Depends: debhelper-compat (= 13),
                python3-pystac,
                python3-pytest <!nocheck>,
                python3-pytest-benchmark <!nocheck>,
+               python3-pytest-console-scripts <!nocheck>,
                python3-pytest-recording <!nocheck>,
                python3-requests,
                python3-requests-mock <!nocheck>


=====================================
debian/rules
=====================================
@@ -1,43 +1,11 @@
 #!/usr/bin/make -f
 
 export PYBUILD_TEST_ARGS=\
---ignore={build_dir}/tests/test_cli.py \
--k "not test_instance \
-and not test_links \
-and not test_from_file \
-and not test_search_max_items_unlimited_default \
-and not test_signing \
-and not test_sign_with_return_warns \
-and not test_get_queryables \
-and not test_get_queryables_collections \
-and not test_changing_conforms_to_changes_behavior \
-and not test_collections_are_clients \
-and not test_get_items_without_ids \
-and not test_non_recursion_on_fallback \
-and not test_instance \
-and not test_get_items \
-and not test_get_items_with_ids \
-and not test_get_item \
-and not test_get_item_with_item_search \
-and not test_get_queryables \
-and not test_localized_datetime_converted_to_utc \
-and not test_results \
-and not test_ids_results \
-and not test_datetime_results \
-and not test_intersects_results \
-and not test_result_paging \
-and not test_result_paging_max_items \
-and not test_item_collection \
-and not test_deprecations \
-and not test_items_as_dicts \
-and not test_query_shortcut_syntax \
-and not test_query_json_syntax \
-and not test_multiple_collections \
-and not test_request_input \
-and not test_str_input \
-and not test_timeout_smoke_test \
-and not test_get_collections_without_conformance_fallsback_to_pystac \
-and not test_fallback_strategy"
+-k "not test_localized_datetime_converted_to_utc" \
+--block-network
 
 %:
 	dh $@ --buildsystem=pybuild
+
+override_dh_auto_test:
+	env https_proxy="" dh_auto_test


=====================================
docs/index.rst
=====================================
@@ -19,6 +19,8 @@ STAC Versions
 +---------------+-----------+-----------------------------+
 | pystac-client | STAC spec | STAC API Spec               |
 +===============+===========+=============================+
+| 0.8.x         | 1.0.x     | 1.0.0-beta.1 - 1.0.0        |
++ --------------+-----------+-----------------------------+
 | 0.7.x         | 1.0.x     | 1.0.0-beta.1 - 1.0.0        |
 +---------------+-----------+-----------------------------+
 | 0.6.x         | 1.0.x     | 1.0.0-beta.1 - 1.0.0-rc.2   |


=====================================
pyproject.toml
=====================================
@@ -53,7 +53,7 @@ dev = [
     "pytest~=8.0",
     "recommonmark~=0.7.1",
     "requests-mock~=1.12",
-    "ruff==0.4.4",
+    "ruff==0.4.5",
     "tomli~=2.0; python_version<'3.11'",
     "types-python-dateutil>=2.8.19,<2.10.0",
     "types-requests~=2.31.0",


=====================================
pystac_client/item_search.py
=====================================
@@ -633,12 +633,12 @@ class ItemSearch:
                 includes.append(field[1:])
             else:
                 includes.append(field)
-        return {"includes": includes, "excludes": excludes}
+        return {"include": includes, "exclude": excludes}
 
     @staticmethod
     def _fields_dict_to_str(fields: Fields) -> str:
-        includes = [f"+{x}" for x in fields.get("includes", [])]
-        excludes = [f"-{x}" for x in fields.get("excludes", [])]
+        includes = [f"+{x}" for x in fields.get("include", [])]
+        excludes = [f"-{x}" for x in fields.get("exclude", [])]
         return ",".join(chain(includes, excludes))
 
     @staticmethod


=====================================
pystac_client/version.py
=====================================
@@ -1 +1 @@
-__version__ = "0.8.0"
+__version__ = "0.8.1"


=====================================
tests/cassettes/test_item_search/test_fields.yaml
=====================================
@@ -0,0 +1,59 @@
+interactions:
+- request:
+    body: '{"collections": ["sentinel-2-c1-l2a"], "intersects": {"type": "Point",
+      "coordinates": [-105.1019, 40.1672]}, "fields": {"include": [], "exclude": ["geometry",
+      "assets", "links"]}}'
+    headers:
+      Accept:
+      - '*/*'
+      Accept-Encoding:
+      - gzip, deflate
+      Connection:
+      - keep-alive
+      Content-Length:
+      - '179'
+      Content-Type:
+      - application/json
+      User-Agent:
+      - python-requests/2.31.0
+    method: POST
+    uri: https://earth-search.aws.element84.com/v1/search
+  response:
+    body:
+      string: '{"type":"FeatureCollection","stac_version":"1.0.0","stac_extensions":[],"context":{"limit":10,"matched":572,"returned":10},"numberMatched":572,"numberReturned":10,"features":[{"stac_version":"1.0.0","bbox":[-105.349918,39.661089,-104.884569,40.650836],"id":"S2A_T13TDE_20240522T174948_L2A","collection":"sentinel-2-c1-l2a","type":"Feature","properties":{"datetime":"2024-05-22T17:52:58.479000Z"}},{"stac_version":"1.0.0","bbox":[-106.183161,39.655762,-104.884569,40.65079],"id":"S2B_T13TDE_20240520T175430_L2A","collection":"sentinel-2-c1-l2a","type":"Feature","properties":{"datetime":"2024-05-20T18:02:54.683000Z"}},{"stac_version":"1.0.0","bbox":[-105.348402,39.661093,-104.884569,40.650836],"id":"S2B_T13TDE_20240517T174143_L2A","collection":"sentinel-2-c1-l2a","type":"Feature","properties":{"datetime":"2024-05-17T17:52:57.296000Z"}},{"stac_version":"1.0.0","bbox":[-106.183161,39.655762,-104.884569,40.65079],"id":"S2A_T13TDE_20240515T175302_L2A","collection":"sentinel-2-c1-l2a","type":"Feature","properties":{"datetime":"2024-05-15T18:02:58.179000Z"}},{"stac_version":"1.0.0","bbox":[-105.368102,39.661033,-104.884569,40.650826],"id":"S2A_T13TDE_20240512T174554_L2A","collection":"sentinel-2-c1-l2a","type":"Feature","properties":{"datetime":"2024-05-12T17:53:02.216000Z"}},{"stac_version":"1.0.0","bbox":[-106.183161,39.655762,-104.884569,40.65079],"id":"S2B_T13TDE_20240510T175043_L2A","collection":"sentinel-2-c1-l2a","type":"Feature","properties":{"datetime":"2024-05-10T18:02:56.145000Z"}},{"stac_version":"1.0.0","bbox":[-105.361809,39.661052,-104.884569,40.650829],"id":"S2B_T13TDE_20240507T174341_L2A","collection":"sentinel-2-c1-l2a","type":"Feature","properties":{"datetime":"2024-05-07T17:52:59.873000Z"}},{"stac_version":"1.0.0","bbox":[-106.183161,39.655762,-104.884569,40.65079],"id":"S2A_T13TDE_20240505T175610_L2A","collection":"sentinel-2-c1-l2a","type":"Feature","properties":{"datetime":"2024-05-05T18:02:58.175000Z"}},{"stac_version":"1.0.0","bbox":[-105.368337,39.661032,-104.884569,40.650825],"id":"S2A_T13TDE_20240502T175028_L2A","collection":"sentinel-2-c1-l2a","type":"Feature","properties":{"datetime":"2024-05-02T17:53:01.904000Z"}},{"stac_version":"1.0.0","bbox":[-106.183161,39.655762,-104.884569,40.65079],"id":"S2B_T13TDE_20240430T175332_L2A","collection":"sentinel-2-c1-l2a","type":"Feature","properties":{"datetime":"2024-04-30T18:02:55.400000Z"}}],"links":[{"rel":"next","title":"Next
+        page of Items","method":"POST","type":"application/geo+json","href":"https://earth-search.aws.element84.com/v1/search","merge":false,"body":{"intersects":{"type":"Point","coordinates":[-105.1019,40.1672]},"fields":{"include":[],"exclude":["geometry","assets","links"]},"collections":["sentinel-2-c1-l2a"],"next":"2024-04-30T18:02:55.400000Z,S2B_T13TDE_20240430T175332_L2A,sentinel-2-c1-l2a"}},{"rel":"root","type":"application/json","href":"https://earth-search.aws.element84.com/v1"}]}'
+    headers:
+      Connection:
+      - keep-alive
+      Content-Length:
+      - '2914'
+      Content-Type:
+      - application/geo+json; charset=utf-8
+      Date:
+      - Thu, 23 May 2024 13:55:07 GMT
+      Via:
+      - 1.1 584febef1233840787d98d1cd03f82c0.cloudfront.net (CloudFront)
+      X-Amz-Cf-Id:
+      - SvrAu9sInbz45xXsZLnU9fYdDuyPI4l5_IVhZTXZaoplQEKQ9CUNKw==
+      X-Amz-Cf-Pop:
+      - DEN52-C1
+      X-Amzn-Trace-Id:
+      - Root=1-664f4abb-67c82c1178b7ad8c4adf165a;Parent=07f14554667b6d8c;Sampled=0;lineage=9e2884e9:0
+      X-Cache:
+      - Miss from cloudfront
+      access-control-allow-origin:
+      - '*'
+      etag:
+      - W/"b62-IhsIfKrcigmqt63/hc9yHpeCjD8"
+      x-amz-apigw-id:
+      - YOidRFT8vHcEj-w=
+      x-amzn-Remapped-content-length:
+      - '2914'
+      x-amzn-RequestId:
+      - d105b93a-e1f1-4d32-b4ef-86a4b3e10525
+      x-powered-by:
+      - Express
+    status:
+      code: 200
+      message: OK
+version: 1


=====================================
tests/test_item_search.py
=====================================
@@ -468,23 +468,23 @@ class TestItemSearchParams:
 
         search = ItemSearch(url=SEARCH_URL, fields="id,collection,+foo,-bar")
         assert search.get_parameters()["fields"] == {
-            "excludes": ["bar"],
-            "includes": ["id", "collection", "foo"],
+            "exclude": ["bar"],
+            "include": ["id", "collection", "foo"],
         }
 
         search = ItemSearch(url=SEARCH_URL, fields=["id", "collection", "+foo", "-bar"])
         assert search.get_parameters()["fields"] == {
-            "excludes": ["bar"],
-            "includes": ["id", "collection", "foo"],
+            "exclude": ["bar"],
+            "include": ["id", "collection", "foo"],
         }
 
         search = ItemSearch(
             url=SEARCH_URL,
-            fields={"excludes": ["bar"], "includes": ["id", "collection"]},
+            fields={"exclude": ["bar"], "include": ["id", "collection"]},
         )
         assert search.get_parameters()["fields"] == {
-            "excludes": ["bar"],
-            "includes": ["id", "collection"],
+            "exclude": ["bar"],
+            "include": ["id", "collection"],
         }
 
         search = ItemSearch(
@@ -500,7 +500,7 @@ class TestItemSearchParams:
         search = ItemSearch(
             url=SEARCH_URL,
             method="GET",
-            fields={"excludes": ["bar"], "includes": ["id", "collection"]},
+            fields={"exclude": ["bar"], "include": ["id", "collection"]},
         )
         assert search.get_parameters()["fields"] == "+id,+collection,-bar"
 
@@ -835,3 +835,18 @@ def test_naive_datetime() -> None:
         method="POST",
     )
     assert search.get_parameters()["datetime"] == "2024-05-14T04:25:42Z"
+
+
+ at pytest.mark.vcr
+def test_fields() -> None:
+    search = ItemSearch(
+        url="https://earth-search.aws.element84.com/v1/search",
+        collections=["sentinel-2-c1-l2a"],
+        intersects={"type": "Point", "coordinates": [-105.1019, 40.1672]},
+        max_items=1,
+        fields=["-geometry", "-assets", "-links"],
+    )
+    item = next(search.items_as_dicts())
+    assert "geometry" not in item
+    assert "assets" not in item
+    assert "links" not in item



View it on GitLab: https://salsa.debian.org/debian-gis-team/pystac-client/-/compare/839a14966ca2d88e3feb96aa7810218db1655296...19e179c67427b2143774db9eb8da18ffaa5d89d2

-- 
This project does not include diff previews in email notifications.
View it on GitLab: https://salsa.debian.org/debian-gis-team/pystac-client/-/compare/839a14966ca2d88e3feb96aa7810218db1655296...19e179c67427b2143774db9eb8da18ffaa5d89d2
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20240524/7481c371/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list