Skip to content

Commit 962ab73

Browse files
committed
merge tag 2.0.2
2 parents 1170b01 + 67a7027 commit 962ab73

File tree

7 files changed

+40
-17
lines changed

7 files changed

+40
-17
lines changed

CHANGES.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
2.0.2 (2023-05-24)
2+
3+
Fixed:
4+
- Fixed bug where SkySatVideo was not recognized as a valid data api item type.
5+
- Fixed wheel name to indicate that only python 3 is supported and updated
6+
build metadata to indicate that the package is now a stable release and only
7+
supports Python 3.
8+
9+
110
2.0.1 (2023-05-10)
211

312
Fixed:
@@ -13,6 +22,7 @@ Docs:
1322
- Update the syntax of example code in the docstrings in the Order and Data
1423
clients and add example code to the Subscriptions client docstring (#943).
1524

25+
1626
2.0.0 (2023-04-17)
1727

1828
User Interface Changes:

planet/cli/data.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
SEARCH_SORT_DEFAULT,
2929
STATS_INTERVAL)
3030

31-
from planet.specs import (get_item_types,
32-
validate_item_type,
31+
from planet.specs import (get_data_item_types,
32+
validate_data_item_type,
3333
SpecificationException)
3434

3535
from . import types
@@ -38,8 +38,8 @@
3838
from .options import limit, pretty
3939
from .session import CliSession
4040

41-
ALL_ITEM_TYPES = get_item_types()
42-
valid_item_string = "Valid entries for ITEM_TYPES: " + "|".join(ALL_ITEM_TYPES)
41+
valid_item_string = "Valid entries for ITEM_TYPES: " + "|".join(
42+
get_data_item_types())
4343

4444

4545
@asynccontextmanager
@@ -75,7 +75,7 @@ def check_item_types(ctx, param, item_types) -> Optional[List[dict]]:
7575
item types.'''
7676
try:
7777
for item_type in item_types:
78-
validate_item_type(item_type)
78+
validate_data_item_type(item_type)
7979
return item_types
8080
except SpecificationException as e:
8181
raise click.BadParameter(str(e))
@@ -85,7 +85,7 @@ def check_item_type(ctx, param, item_type) -> Optional[List[dict]]:
8585
'''Validates the item type provided by comparing it to all supported
8686
item types.'''
8787
try:
88-
validate_item_type(item_type)
88+
validate_data_item_type(item_type)
8989
except SpecificationException as e:
9090
raise click.BadParameter(str(e))
9191

planet/clients/data.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from ..constants import PLANET_BASE_URL
2626
from ..http import Session
2727
from ..models import Paged, StreamingBody
28-
from ..specs import validate_item_type
28+
from ..specs import validate_data_item_type
2929

3030
BASE_URL = f'{PLANET_BASE_URL}/data/v1/'
3131
SEARCHES_PATH = '/searches'
@@ -147,7 +147,7 @@ async def search(self,
147147

148148
search_filter = search_filter or empty_filter()
149149

150-
item_types = [validate_item_type(item) for item in item_types]
150+
item_types = [validate_data_item_type(item) for item in item_types]
151151
request_json = {'filter': search_filter, 'item_types': item_types}
152152
if name:
153153
request_json['name'] = name
@@ -204,7 +204,7 @@ async def create_search(self,
204204
"""
205205
url = self._searches_url()
206206

207-
item_types = [validate_item_type(item) for item in item_types]
207+
item_types = [validate_data_item_type(item) for item in item_types]
208208
request = {
209209
'name': name,
210210
'filter': search_filter,
@@ -237,7 +237,7 @@ async def update_search(self,
237237
"""
238238
url = f'{self._searches_url()}/{search_id}'
239239

240-
item_types = [validate_item_type(item) for item in item_types]
240+
item_types = [validate_data_item_type(item) for item in item_types]
241241
request = {
242242
'name': name,
243243
'filter': search_filter,
@@ -396,7 +396,7 @@ async def get_stats(self,
396396

397397
url = f'{self._base_url}{STATS_PATH}'
398398

399-
item_types = [validate_item_type(item) for item in item_types]
399+
item_types = [validate_data_item_type(item) for item in item_types]
400400
request = {
401401
'interval': interval,
402402
'filter': search_filter,
@@ -450,7 +450,7 @@ async def get_asset(self,
450450
planet.exceptions.ClientError: If asset type identifier is not
451451
valid.
452452
"""
453-
item_type_id = validate_item_type(item_type_id)
453+
item_type_id = validate_data_item_type(item_type_id)
454454
assets = await self.list_item_assets(item_type_id, item_id)
455455

456456
try:

planet/specs.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,17 @@ def validate_item_type(item_type):
7070
return _validate_field(item_type, supported_item_types, 'item_type')
7171

7272

73+
def validate_data_item_type(item_type):
74+
'''Validate and correct capitalization of data api item type.'''
75+
return _validate_field(item_type, get_data_item_types(), 'item_type')
76+
77+
78+
def get_data_item_types():
79+
'''Item types supported by the data api.'''
80+
# This is a quick-fix for gh-956, to be superseded by gh-960
81+
return get_item_types() | {'SkySatVideo'}
82+
83+
7384
def validate_order_type(order_type):
7485
return _validate_field(order_type, SUPPORTED_ORDER_TYPES, 'order_type')
7586

setup.cfg

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
[bdist_wheel]
2-
universal: 1
3-
41
[metadata]
52
license_file: LICENSE
63

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@
5151
long_description=Path("README.md").read_text("utf-8"),
5252
long_description_content_type="text/markdown",
5353
classifiers=[
54-
'Development Status :: 3 - Alpha',
54+
'Development Status :: 5 - Production/Stable',
5555
'Environment :: Console',
5656
'Intended Audience :: Developers',
5757
'License :: OSI Approved :: Apache Software License',
5858
'Operating System :: OS Independent',
59-
'Programming Language :: Python',
59+
'Programming Language :: Python :: 3',
6060
'Topic :: Scientific/Engineering',
6161
'Topic :: Software Development',
6262
'Topic :: Utilities'

tests/unit/test_specs.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ def test_validate_item_type_notsupported_itemtype():
103103
specs.validate_item_type('notsupported')
104104

105105

106+
def test_validate_data_item_type():
107+
'''ensure skysatvideo is included'''
108+
specs.validate_data_item_type('skysatvideo')
109+
110+
106111
def test_validate_order_type_supported():
107112
assert 'full' == specs.validate_order_type('FULL')
108113

0 commit comments

Comments
 (0)