Skip to content

Commit 73a9126

Browse files
author
Jon Duckworth
authored
Merge pull request #455 from duckontheweb/issues_333_334
Fix 1.0.0-rc.1 extensions and 1.0.0-beta.1 schema links
2 parents 6937607 + 7b3acf9 commit 73a9126

File tree

16 files changed

+213
-106
lines changed

16 files changed

+213
-106
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,4 +156,4 @@ dmypy.json
156156
.pytype/
157157

158158
# Cython debug symbols
159-
cython_debug/
159+
cython_debug/

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
([#402](https://github.com/stac-utils/pystac/pull/402))
3434
- `ExtensionManagementMixin.add_to` is now idempotent (only adds schema URI to
3535
`stac_extensions` once per `Item` regardless of the number of calls) ([#419](https://github.com/stac-utils/pystac/pull/419))
36+
- Version check for when extensions changed from short links to schema URIs
37+
([#455](https://github.com/stac-utils/pystac/pull/455))
38+
- Schema URI base for STAC 1.0.0-beta.1 ([#455](https://github.com/stac-utils/pystac/pull/455))
3639

3740
### Removed
3841

pystac/validation/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ def validate_dict(
8585

8686
stac_version_id = STACVersionID(stac_version)
8787

88-
# If the version is before 1.0.0-rc.1, substitute extension short IDs for
88+
# If the version is before 1.0.0-rc.2, substitute extension short IDs for
8989
# their schemas.
90-
if stac_version_id < "1.0.0-rc.1":
90+
if stac_version_id < "1.0.0-rc.2":
9191

9292
def _get_uri(ext: str) -> Optional[str]:
9393
return OldExtensionSchemaUriMap.get_extension_schema_uri(

pystac/validation/schema_uri_map.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ class DefaultSchemaUriMap(SchemaUriMap):
4545
# the schema.
4646
BASE_URIS: List[Tuple[STACVersionRange, Callable[[str], str]]] = [
4747
(
48-
STACVersionRange(min_version="1.0.0-beta.1"),
48+
STACVersionRange(min_version="1.0.0-beta.2"),
4949
lambda version: "https://schemas.stacspec.org/v{}".format(version),
5050
),
5151
(
52-
STACVersionRange(min_version="0.8.0", max_version="0.9.0"),
52+
STACVersionRange(min_version="0.8.0", max_version="1.0.0-beta.1"),
5353
lambda version: (
5454
f"https://raw.githubusercontent.com/radiantearth/stac-spec/v{version}"
5555
),
@@ -96,7 +96,6 @@ def get_object_schema_uri(
9696

9797
if object_type not in self.DEFAULT_SCHEMA_MAP:
9898
raise KeyError("Unknown STAC object type {}".format(object_type))
99-
10099
uri = self.DEFAULT_SCHEMA_MAP[object_type][0]
101100
if not is_latest:
102101
if self.DEFAULT_SCHEMA_MAP[object_type][1]:
@@ -127,11 +126,11 @@ def get_base_uris(
127126
) -> List[Tuple[STACVersionRange, Callable[[STACVersionID], str]]]:
128127
return [
129128
(
130-
STACVersionRange(min_version="1.0.0-beta.1"),
129+
STACVersionRange(min_version="1.0.0-beta.2"),
131130
lambda version: f"https://schemas.stacspec.org/v{version}",
132131
),
133132
(
134-
STACVersionRange(min_version="0.8.0", max_version="0.9.0"),
133+
STACVersionRange(min_version="0.8.0", max_version="1.0.0-beta.1"),
135134
lambda version: (
136135
"https://raw.githubusercontent.com/"
137136
f"radiantearth/stac-spec/v{version}"

tests/data-files/examples/1.0.0-RC1/README.md

Lines changed: 0 additions & 89 deletions
This file was deleted.

tests/data-files/examples/1.0.0-RC1/catalog.json

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "examples",
33
"type": "Catalog",
4-
"stac_version": "1.0.0-beta.2",
4+
"stac_version": "1.0.0-rc.1",
55
"description": "This catalog is a simple demonstration of an example catalog that is used to organize a hierarchy of collections and their items.",
66
"links": [
77
{

tests/data-files/examples/1.0.0-RC1/collection-only/collection.json

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"type": "Collection",
3-
"stac_version": "1.0.0-beta.2",
3+
"stac_version": "1.0.0-rc.1",
44
"stac_extensions": [],
55
"id": "sentinel-2",
66
"title": "Sentinel-2 MSI: MultiSpectral Instrument, Level-1C",

tests/data-files/examples/1.0.0-RC1/collection.json

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "simple-collection",
33
"type": "Collection",
4-
"stac_version": "1.0.0-beta.2",
4+
"stac_version": "1.0.0-rc.1",
55
"description": "A simple collection demonstrating core catalog fields with links to a couple of items",
66
"title": "Simple Example Collection",
77
"providers": [

tests/data-files/examples/1.0.0-RC1/collectionless-item.json

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"stac_version": "1.0.0-beta.2",
2+
"stac_version": "1.0.0-rc.1",
33
"stac_extensions": [
44
"eo",
55
"view"

tests/data-files/examples/1.0.0-RC1/core-item.json

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"stac_version": "1.0.0-beta.2",
2+
"stac_version": "1.0.0-rc.1",
33
"stac_extensions": [],
44
"type": "Feature",
55
"id": "20201211_223832_CS2",

tests/data-files/examples/1.0.0-RC1/extended-item.json

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"stac_version": "1.0.0-beta.2",
2+
"stac_version": "1.0.0-rc.1",
33
"stac_extensions": [
44
"eo",
55
"projection",

tests/data-files/examples/1.0.0-RC1/extensions-collection/collection.json

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "extensions-collection",
33
"type": "Collection",
4-
"stac_version": "1.0.0-beta.2",
4+
"stac_version": "1.0.0-rc.1",
55
"description": "A heterogenous collection containing deeper examples of various extensions",
66
"links": [
77
{

tests/data-files/examples/1.0.0-RC1/extensions-collection/proj-example/proj-example.json

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"type": "Feature",
3-
"stac_version": "1.0.0-beta.2",
3+
"stac_version": "1.0.0-rc.1",
44
"id": "proj-example",
55
"properties": {
66
"datetime": "2018-10-01T01:08:32.033000Z",

tests/data-files/examples/1.0.0-RC1/simple-item.json

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"stac_version": "1.0.0-beta.2",
2+
"stac_version": "1.0.0-rc.1",
33
"stac_extensions": [],
44
"type": "Feature",
55
"id": "20201211_223832_CS2",

0 commit comments

Comments
 (0)