Skip to content

Commit 809d540

Browse files
authored
[ARC-3069] Introduce default provider property values (#763)
* Introduce default provider property values * Drop type changes * Bump version and update changelog entries
1 parent 5c64523 commit 809d540

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ You can check your current version with the following command:
3131
For more information, see [UP42 Python package description](https://pypi.org/project/up42-py/).
3232

3333

34+
### 2.5.0a3
35+
**Aug 4, 2025**
36+
- Added default property values for `Provider` class to simplify a host creation by name.
37+
- Exported `Provider` class to the global `up42` namespace.
38+
3439
### 2.5.0a2
3540
**July 25, 2025**
3641
- Added a new processing job template: `UpsamplingNSSentinel`.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "up42-py"
3-
version = "2.5.0a2"
3+
version = "2.5.0a3"
44
description = "Python SDK for UP42, the geospatial marketplace and developer platform."
55
authors = ["UP42 GmbH <[email protected]>"]
66
license = "https://github.com/up42/up42-py/blob/master/LICENSE"

up42/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from up42.asset import Asset, AssetSorting
2424
from up42.base import authenticate, get_credits_balance, stac_client
2525
from up42.catalog import Catalog
26-
from up42.glossary import CollectionSorting, CollectionType, ProductGlossary
26+
from up42.glossary import CollectionSorting, CollectionType, ProductGlossary, Provider
2727
from up42.initialization import (
2828
initialize_asset,
2929
initialize_catalog,
@@ -77,6 +77,7 @@
7777
CollectionSorting,
7878
CollectionType,
7979
ProductGlossary,
80+
Provider,
8081
BatchOrderTemplate,
8182
Quotation,
8283
QuotationSorting,

up42/glossary.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,12 @@ class InvalidHost(ValueError):
6969
class Provider:
7070
session = base.Session()
7171
name: str
72-
title: str
73-
description: str
74-
roles: list[Literal["PRODUCER", "HOST"]]
72+
# TODO: switch to Optional[str] = None in 3.0.0
73+
title: str = ""
74+
# TODO: switch to Optional[str] = None in 3.0.0
75+
description: str = ""
76+
# TODO: switch Sequence[Literal["PRODUCER", "HOST"]] = ("HOST",) in 3.0.0
77+
roles: list[Literal["PRODUCER", "HOST"]] = dataclasses.field(default_factory=lambda: ["HOST"])
7578

7679
@property
7780
def is_host(self):

0 commit comments

Comments
 (0)