Skip to content

Commit b73a3b0

Browse files
cauriolsbrunato
andauthored
refactor: remove peps provider (#102)
Removes peps provider as its end-of-service is planned on 2026-03-25. All providers now have the same priority level (0). peps is replaced with cop_dataspace in documentation examples and tests. See https://geodes.cnes.fr/peps-clap-de-fin-pour-la-plateforme-francaise-dacces-aux-donnees-sentinel-peps/ --------- Signed-off-by: cauriol <camille.auriol@cs-soprasteria.com> Co-authored-by: Sylvain Brunato <61419125+sbrunato@users.noreply.github.com>
1 parent 780c7fd commit b73a3b0

9 files changed

Lines changed: 42 additions & 57 deletions

File tree

helm/stac-fastapi-eodag/values.yaml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -137,18 +137,6 @@ providers: ""
137137
## doc: https://eodag.readthedocs.io/en/stable/getting_started_guide/configure.html
138138
## ref: https://github.com/CS-SI/eodag/blob/master/eodag/resources/user_conf_template.yml
139139
config:
140-
# peps:
141-
# priority: # Lower value means lower priority (Default: 1)
142-
# search: # Search parameters configuration
143-
# download:
144-
# extract: # whether to extract the downloaded products, only applies to archived products (true or false, Default: true).
145-
# outputs_prefix: # where to store downloaded products, as an absolute file path (Default: local temporary directory)
146-
# dl_url_params: # additional parameters to pass over to the download url as an url parameter
147-
# delete_archive: # whether to delete the downloaded archives (true or false, Default: true).
148-
# auth:
149-
# credentials:
150-
# username:
151-
# password:
152140
# cop_cds:
153141
# priority: # Lower value means lower priority (Default: 0)
154142
# api:

tests/conftest.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ def app() -> Iterator[FastAPI]:
113113
"""
114114
providers_dict = ProvidersDict(
115115
{
116-
"peps": Provider(
116+
"cop_dataspace": Provider(
117117
ProviderConfig.from_mapping(
118118
{
119-
"name": "peps",
120-
"url": "https://peps.cnes.fr",
119+
"name": "cop_dataspace",
120+
"url": "https://dataspace.copernicus.eu",
121121
"search": {"type": "QueryStringSearch"},
122122
"products": {"S2_MSI_L1C": {"_collection": "SENTINEL-2"}},
123123
}
@@ -177,9 +177,9 @@ def mock_search_result():
177177
"keywords": [],
178178
"product:type": "OCN",
179179
"eodag:download_link": (
180-
"https://peps.cnes.fr/resto/collections/S1/578f1768-e66e-5b86-9363-b19f8931cc7b/download"
180+
"https://catalogue.dataspace.copernicus.eu/odata/v1/Products(578f1768-e66e-5b86-9363-b19f8931cc7b)/$value"
181181
),
182-
"eodag:provider": "peps",
182+
"eodag:provider": "cop_dataspace",
183183
"collection": "S1_SAR_OCN",
184184
"platform": "S1A",
185185
"eo:cloud_cover": 0,
@@ -208,7 +208,7 @@ def mock_search_result():
208208
"sar:instrument_mode": None,
209209
"quicklook": None,
210210
"order:status": ONLINE_STATUS,
211-
"peps:providerProperty": "foo",
211+
"cop_dataspace:providerProperty": "foo",
212212
},
213213
"id": "578f1768-e66e-5b86-9363-b19f8931cc7b",
214214
"type": "Feature",
@@ -224,7 +224,7 @@ def mock_search_result():
224224
],
225225
"type": "Polygon",
226226
},
227-
"assets": {"asset1": {"title": "asset1", "href": "https://peps.cnes.fr"}},
227+
"assets": {"asset1": {"title": "asset1", "href": "https://catalogue.dataspace.copernicus.eu"}},
228228
},
229229
{
230230
"properties": {
@@ -234,9 +234,9 @@ def mock_search_result():
234234
"keywords": [],
235235
"product:type": "OCN",
236236
"eodag:download_link": (
237-
"https://peps.cnes.fr/resto/collections/S1/578f1768-e66e-5b86-9363-b19f8931cc7c/download"
237+
"https://catalogue.dataspace.copernicus.eu/odata/v1/Products(578f1768-e66e-5b86-9363-b19f8931cc7c)/$value"
238238
),
239-
"eodag:provider": "peps",
239+
"eodag:provider": "cop_dataspace",
240240
"collection": "S1_SAR_OCN",
241241
"platform": "S1A",
242242
"eo:cloud_cover": 0,
@@ -288,8 +288,8 @@ def mock_search_result():
288288
config = PluginConfig()
289289
config.priority = 0
290290
for p in search_result:
291-
p.downloader = Download("peps", config)
292-
p.downloader_auth = Authentication("peps", config)
291+
p.downloader = Download("cop_dataspace", config)
292+
p.downloader_auth = Authentication("cop_dataspace", config)
293293
search_result.number_matched = None
294294
return search_result
295295

tests/resources/wrong_credentials_conf.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,6 @@ meteoblue:
9898
auth:
9999
credentials:
100100
apikey: wrong_apikey
101-
peps:
102-
auth:
103-
credentials:
104-
password: wrong_password
105-
username: wrong_username
106101
planetary_computer:
107102
auth:
108103
credentials:

tests/test_app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
async def test_landing_page(request_valid):
2424
"""Test the root route."""
2525
response = await request_valid("/")
26-
assert response["federation"]["peps"] == {
27-
"title": "peps",
26+
assert response["federation"]["cop_dataspace"] == {
27+
"title": "cop_dataspace",
2828
"description": ANY,
29-
"url": "https://peps.cnes.fr",
29+
"url": "https://dataspace.copernicus.eu",
3030
}
3131
assert len(response["federation"]) > 1
3232
assert "https://api.openeo.org/extensions/federation/0.1.0" in response["stac_extensions"]

tests/test_collections.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ async def test_search_collections_query(app_client, mock_list_collections):
9999
collection1 = Collection(id="S2_MSI_L1C", title="SENTINEL2 Level-1C")
100100
collection2 = Collection(id="S2_MSI_L2A")
101101
mock_list_collections.return_value = CollectionsList([collection1, collection2])
102-
r = await app_client.get('/collections?query={"federation:backends":{"eq":"peps"}}')
102+
r = await app_client.get('/collections?query={"federation:backends":{"eq":"cop_dataspace"}}')
103103

104-
mock_list_collections.assert_called_once_with(provider="peps", fetch_providers=False)
104+
mock_list_collections.assert_called_once_with(provider="cop_dataspace", fetch_providers=False)
105105
assert r.status_code == 200
106106
assert ["S2_MSI_L1C", "S2_MSI_L2A"] == [col["id"] for col in r.json().get("collections", [])]
107107

tests/test_dag.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def fixture_mock_fetch_external_stac_collections(mocker: MockerFixture) -> Magic
122122
"test-product": {
123123
"id": "test-product",
124124
"title": "Mocked Title",
125-
"description": "Mocked Description",
125+
"description": "Not Available",
126126
"license": "Mocked License",
127127
"summaries": {
128128
"platform": ["Mocked Platform"],
@@ -191,7 +191,7 @@ def fixture_mock_dag() -> MagicMock:
191191
{
192192
"id": "test-product",
193193
"title": "Mocked Title",
194-
"description": "Mocked Description",
194+
"description": "Not Available",
195195
"keywords": ["keyword1", "keyword2"],
196196
"instruments": ["Mocked Instrument"],
197197
"platform": "Mocked Platform",
@@ -226,7 +226,7 @@ def fixture_mock_dag() -> MagicMock:
226226
{
227227
"id": "test-product",
228228
"title": "Existing Title",
229-
"description": "Mocked Description",
229+
"description": "Not Available",
230230
"keywords": ["keyword1", "keyword2"],
231231
"instruments": ["Existing Instrument"],
232232
"platform": "Mocked Platform",

tests/test_download.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ async def test_download_item_from_collection_stream(
3535
"""Download through eodag server catalog should return a valid response"""
3636
mock_base_stream_download.return_value = stream_response
3737

38-
resp = await request_valid_raw(f"data/peps/{defaults.collection}/foo/downloadLink")
38+
resp = await request_valid_raw(f"data/cop_dataspace/{defaults.collection}/foo/downloadLink")
3939
assert resp.content == b"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
4040
assert resp.headers["content-disposition"] == 'attachment; filename="alphabet.txt"'
4141
assert resp.headers["content-type"] == "text/plain"
@@ -51,7 +51,7 @@ async def test_download_item_from_collection_no_stream(
5151
mock_download.return_value = expected_file
5252
mock_base_stream_download.side_effect = NotImplementedError()
5353

54-
await request_valid_raw(f"data/peps/{defaults.collection}/foo/downloadLink")
54+
await request_valid_raw(f"data/cop_dataspace/{defaults.collection}/foo/downloadLink")
5555
mock_download.assert_called_once()
5656
# downloaded file should have been immediatly deleted from the server
5757
assert not os.path.exists(expected_file), f"File {expected_file} should have been deleted"
@@ -69,12 +69,12 @@ async def test_download_auto_order_whitelist(
6969
"""Test that the order method is called when downloading a product
7070
from a federation backend included in the auto_order_whitelist.
7171
72-
This test simulates downloading a product from a federated backend ('peps')
72+
This test simulates downloading a product from a federated backend ('cop_dataspace')
7373
and checks that the order function is triggered when the backend is present
7474
in the auto_order_whitelist configuration.
7575
"""
76-
federation_backend = "peps"
77-
# update the auto_order_whitelist setting to include "peps"
76+
federation_backend = "cop_dataspace"
77+
# update the auto_order_whitelist setting to include "cop_dataspace"
7878
auto_order_whitelist = get_settings().auto_order_whitelist
7979
get_settings().auto_order_whitelist = [federation_backend]
8080

tests/test_errors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ async def test_search_no_results_with_errors(app, app_client, mocker):
3030
errors = [
3131
("usgs", Exception("Generic exception", "Details of the error")),
3232
("theia", TimeOutError("Timeout message")),
33-
("peps", req_err),
33+
("cop_dataspace", req_err),
3434
("creodias", AuthenticationError("Authentication message")),
3535
(
3636
"creodias_s3",
@@ -58,7 +58,7 @@ async def test_search_no_results_with_errors(app, app_client, mocker):
5858
"status_code": 504,
5959
},
6060
{
61-
"provider": "peps",
61+
"provider": "cop_dataspace",
6262
"error": "RequestError",
6363
"message": "Request error message with status code",
6464
"status_code": 400,

tests/test_search.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ async def test_items_response(request_valid, defaults):
122122
"geometry",
123123
"properties",
124124
}
125-
assert first_props["federation:backends"] == ["peps"]
125+
assert first_props["federation:backends"] == ["cop_dataspace"]
126126
assert first_props["datetime"] == "2018-02-15T23:53:22.871Z"
127127
assert first_props["start_datetime"] == "2018-02-15T23:53:22.871Z"
128128
assert first_props["end_datetime"] == "2018-02-16T00:12:14.035Z"
@@ -136,14 +136,14 @@ async def test_items_response(request_valid, defaults):
136136
assert "asset1" in res[0]["assets"]
137137
assert (
138138
res[0]["assets"]["asset1"]["href"]
139-
== f"http://testserver/data/peps/{res[0]['collection']}/{res[0]['id']}/asset1"
139+
== f"http://testserver/data/cop_dataspace/{res[0]['collection']}/{res[0]['id']}/asset1"
140140
)
141141
assert res[1]["properties"]["order:status"] == "orderable"
142142
assert "assets" in res[0]
143143
assert "asset1" in res[0]["assets"]
144144
assert (
145145
res[0]["assets"]["asset1"]["href"]
146-
== f"http://testserver/data/peps/{res[0]['collection']}/{res[0]['id']}/asset1"
146+
== f"http://testserver/data/cop_dataspace/{res[0]['collection']}/{res[0]['id']}/asset1"
147147
)
148148
expected_extensions = [
149149
"https://stac-extensions.github.io/sat/v1.0.0/schema.json",
@@ -155,9 +155,9 @@ async def test_items_response(request_valid, defaults):
155155
for ext in expected_extensions:
156156
assert ext in res[0]["stac_extensions"]
157157

158-
# check order status and storage tier properties of the "OFFLINE" item when peps is whitelisted
158+
# check order status and storage tier properties of the "OFFLINE" item when cop_dataspace is whitelisted
159159
auto_order_whitelist = get_settings().auto_order_whitelist
160-
get_settings().auto_order_whitelist = ["peps"]
160+
get_settings().auto_order_whitelist = ["cop_dataspace"]
161161

162162
resp_json = await request_valid(
163163
f"search?collections={defaults.collection}",
@@ -197,7 +197,7 @@ async def test_assets_with_different_download_base_url(request_valid, defaults):
197197
assert "asset1" in res[0]["assets"]
198198
assert (
199199
res[0]["assets"]["asset1"]["href"]
200-
== f"http://otherserver/data/peps/{res[0]['collection']}/{res[0]['id']}/asset1"
200+
== f"http://otherserver/data/cop_dataspace/{res[0]['collection']}/{res[0]['id']}/asset1"
201201
)
202202

203203

@@ -508,7 +508,7 @@ async def test_search_response_contains_pagination_info(request_valid, defaults)
508508
[
509509
(None, None, [False, False, False, False]),
510510
(True, None, [True, True, True, True]),
511-
(True, "https://peps.cnes.fr", [False, False, True, False]),
511+
(True, "https://catalogue.dataspace.copernicus.eu", [False, False, True, False]),
512512
],
513513
ids=[
514514
"no alt links by default",
@@ -528,7 +528,7 @@ async def test_assets_alt_url_blacklist(
528528
"""Search through eodag server must not have alternate link if in blacklist"""
529529

530530
search_result = mock_search_result
531-
search_result[0].assets.update({"asset1": {"href": "https://peps.cnes.fr"}})
531+
search_result[0].assets.update({"asset1": {"href": "https://catalogue.dataspace.copernicus.eu"}})
532532
search_result[1].assets.update({"asset1": {"href": "https://somewhere.fr"}})
533533
# make assets of the second product available for this test
534534
search_result[1].properties["order:status"] = ONLINE_STATUS
@@ -552,17 +552,17 @@ async def test_assets_alt_url_blacklist(
552552
(
553553
"POST",
554554
"search",
555-
{"collections": ["{defaults.collection}"], "query": {"federation:backends": {"eq": "peps"}}},
556-
{"provider": "peps"},
555+
{"collections": ["{defaults.collection}"], "query": {"federation:backends": {"eq": "cop_dataspace"}}},
556+
{"provider": "cop_dataspace"},
557557
),
558558
# POST with no provider specified
559559
("POST", "search", {"collections": ["{defaults.collection}"]}, {}),
560560
# GET with provider specified
561561
(
562562
"GET",
563-
'search?collections={defaults.collection}&query={{"federation:backends":{{"eq":"peps"}} }}',
563+
'search?collections={defaults.collection}&query={{"federation:backends":{{"eq":"cop_dataspace"}} }}',
564564
None,
565-
{"provider": "peps"},
565+
{"provider": "cop_dataspace"},
566566
),
567567
# GET with no provider specified
568568
("GET", "search?collections={defaults.collection}", None, {}),
@@ -684,7 +684,7 @@ async def test_pagination_basic(request_valid, defaults, method, has_next_token,
684684
# Create search result based on whether next token should be present
685685
if has_next_token:
686686
search_result = SearchResult(
687-
[EOProduct("peps", {"id": "_", "collection": "_"})] * 10, next_page_token=next_token
687+
[EOProduct("cop_dataspace", {"id": "_", "collection": "_"})] * 10, next_page_token=next_token
688688
)
689689
else:
690690
search_result = SearchResult([])
@@ -740,7 +740,9 @@ async def test_pagination_with_token(request_valid, defaults, method):
740740
next_token = "next_token_456"
741741

742742
# Create a mock search result for the next page
743-
search_result = SearchResult([EOProduct("peps", {"id": "_", "collection": "_"})] * 10, next_page_token=next_token)
743+
search_result = SearchResult(
744+
[EOProduct("cop_dataspace", {"id": "_", "collection": "_"})] * 10, next_page_token=next_token
745+
)
744746

745747
# Set up request parameters based on method
746748
if method == "GET":

0 commit comments

Comments
 (0)