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

Avoid implicit re-exports #591

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

### Changed

- Enable [strict
mode](https://mypy.readthedocs.io/en/latest/command_line.html?highlight=strict%20mode#cmdoption-mypy-strict)
for `mypy` ([#591](https://github.com/stac-utils/pystac/pull/591))

### Fixed

- Avoid implicit re-exports ([#591](https://github.com/stac-utils/pystac/pull/591))

### Deprecated

## [v1.1.0]
Expand Down
14 changes: 1 addition & 13 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
[mypy]
check_untyped_defs = True
disallow_any_generics = True
disallow_incomplete_defs = True
disallow_subclassing_any = True
disallow_untyped_calls = True
disallow_untyped_decorators = True
disallow_untyped_defs = True
no_implicit_optional = True
show_error_codes = True
strict_equality = True
warn_redundant_casts = True
warn_return_any = True
warn_unused_configs = True
warn_unused_ignores = True
strict = True

[mypy-jsonschema.*]
ignore_missing_imports = True
Expand Down
43 changes: 40 additions & 3 deletions pystac/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,43 @@
"""
PySTAC is a library for working with SpatioTemporal Asset Catalogs (STACs)
"""
__all__ = [
"__version__",
"STACError",
"STACTypeError",
"DuplicateObjectKeyError",
"ExtensionAlreadyExistsError",
"ExtensionNotImplemented",
"ExtensionTypeError",
"RequiredPropertyMissing",
"STACValidationError",
"MediaType",
"RelType",
"StacIO",
"STACObject",
"STACObjectType",
"Link",
"HIERARCHICAL_LINKS",
"Catalog",
"CatalogType",
"Collection",
"Extent",
"SpatialExtent",
"TemporalExtent",
"Summaries",
"CommonMetadata",
"RangeSummary",
"Item",
"Asset",
"ItemCollection",
"Provider",
"ProviderRole",
"read_file",
"read_dict",
"write_file",
"get_stac_version",
"set_stac_version",
]

from pystac.errors import (
STACError,
Expand Down Expand Up @@ -30,11 +67,11 @@
Extent,
SpatialExtent,
TemporalExtent,
Summaries,
)
from pystac.common_metadata import CommonMetadata
from pystac.summaries import RangeSummary
from pystac.item import Item, Asset
from pystac.summaries import RangeSummary, Summaries
from pystac.asset import Asset
from pystac.item import Item
from pystac.item_collection import ItemCollection
from pystac.provider import ProviderRole, Provider
import pystac.validation
Expand Down
3 changes: 2 additions & 1 deletion pystac/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
from pystac.utils import is_absolute_href, make_absolute_href, make_relative_href

if TYPE_CHECKING:
from pystac.item import Asset as Asset_Type, Item as Item_Type
from pystac.asset import Asset as Asset_Type
from pystac.item import Item as Item_Type
from pystac.collection import Collection as Collection_Type


Expand Down
7 changes: 7 additions & 0 deletions pystac/serialization/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
__all__ = [
"merge_common_properties",
"migrate_to_latest",
"STACVersionRange",
"identify_stac_object",
"identify_stac_object_type",
]
from pystac.serialization.identify import (
STACVersionRange,
identify_stac_object,
Expand Down
2 changes: 1 addition & 1 deletion tests/extensions/test_scientific.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from pystac import ExtensionTypeError
from pystac.link import Link
from pystac.collection import Summaries
from pystac.summaries import Summaries
import unittest
from typing import List, Optional

Expand Down
7 changes: 7 additions & 0 deletions tests/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
__all__ = [
"TestCases",
"ARBITRARY_GEOM",
"ARBITRARY_BBOX",
"ARBITRARY_EXTENT",
"MockStacIO",
]
from typing import Any, Dict, TYPE_CHECKING, Type
import unittest
from tests.utils.test_cases import (
Expand Down