Skip to content
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## [Unreleased]

- Remove unused pystac.validation import ([#1583](https://github.com/stac-utils/pystac/pull/1583))

## [v1.14.1] - 2025-09-18

### Fixed
Expand Down
16 changes: 15 additions & 1 deletion pystac/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
from pystac.item_collection import ItemCollection
from pystac.provider import ProviderRole, Provider
from pystac.utils import HREF
import pystac.validation

import pystac.extensions.hooks
import pystac.extensions.classification
Expand Down Expand Up @@ -239,3 +238,18 @@ def read_dict(
if stac_io is None:
stac_io = StacIO.default()
return stac_io.stac_object_from_dict(d, href, root)


def __getattr__(name: str) -> Any:
if name == "validation":
import warnings
import pystac.validation

warnings.warn(
"pystac.validation will not be automatically imported to the package in "
"pystac v2.0. Instead, import it directly: `import pystac.validation`",
DeprecationWarning,
stacklevel=2,
)
return pystac.validation
raise AttributeError(f"module '{__name__}' has no attribute '{name}'")