Skip to content

Commit

Permalink
Merge pull request #138 from vincentsarago/feature/remove-context-ext…
Browse files Browse the repository at this point in the history
…ension

(feature): remove the deprecated Context Extension
  • Loading branch information
vincentsarago authored Apr 4, 2024
2 parents c03272e + 9eaeb6d commit b4b66f3
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 120 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@

3.1.0 (TBD)
-----------------
- Remove the deprecated `Context` extension (#138, @vincentsarago)

3.0.0 (2024-01-25)
------------------
- Support pydantic>2.0 (@huard)
Expand Down
35 changes: 0 additions & 35 deletions stac_pydantic/api/extensions/context.py

This file was deleted.

4 changes: 0 additions & 4 deletions stac_pydantic/api/item_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

from pydantic import model_validator

from stac_pydantic.api.extensions.context import ContextExtension
from stac_pydantic.api.item import Item
from stac_pydantic.api.links import Links
from stac_pydantic.item_collection import ItemCollection as BaseItemCollection
Expand All @@ -21,9 +20,6 @@ class ItemCollection(BaseItemCollection):
numberMatched: Optional[int] = None
numberReturned: Optional[int] = None

# Context Extension
context: Optional[ContextExtension] = None

@model_validator(mode="after")
def required_links(self) -> "ItemCollection":
if self.links:
Expand Down
75 changes: 0 additions & 75 deletions tests/api/extensions/test_context.py

This file was deleted.

6 changes: 0 additions & 6 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from shapely.geometry import shape

from stac_pydantic import Collection, Item, ItemProperties
from stac_pydantic.api.extensions.context import ContextExtension
from stac_pydantic.extensions import validate_extensions
from stac_pydantic.links import Link, Links
from stac_pydantic.shared import MimeTypes
Expand Down Expand Up @@ -161,11 +160,6 @@ def test_geo_interface() -> None:
Item(**test_item)


def test_api_context_extension() -> None:
context = {"returned": 10, "limit": 10, "matched": 100}
ContextExtension(**context)


def test_declared_model() -> None:
class TestProperties(ItemProperties):
foo: str
Expand Down

0 comments on commit b4b66f3

Please sign in to comment.