Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feature): remove the deprecated Context Extension #138

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can decide later if we want to do a 4.0.0 instead

-----------------
- 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
Loading