wherobots-python-sdk 0.1.0__py3-none-any.whl → 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
wherobots/__version__.py CHANGED
@@ -1,5 +1,5 @@
1
1
  """Version information."""
2
2
 
3
- __version__ = "0.1.0"
3
+ __version__ = "0.2.0"
4
4
  __author__ = "Wherobots"
5
5
  __email__ = "support@wherobots.com"
wherobots/api/runs.py CHANGED
@@ -101,15 +101,15 @@ class RunsAPI:
101
101
  def create(
102
102
  self,
103
103
  payload: CreateRunPayload,
104
- region: str = "aws-us-west-2",
104
+ region: str | None = None,
105
105
  ) -> RunView:
106
106
  """Submit a new job run (``POST /runs``).
107
107
 
108
108
  Args:
109
109
  payload: The run configuration including script/JAR
110
110
  details, runtime, and resource settings.
111
- region: Wherobots deployment region (default
112
- ``"aws-us-west-2"``).
111
+ region: Wherobots deployment region. When omitted, the API
112
+ applies the organization's configured default region.
113
113
 
114
114
  Returns:
115
115
  A ``RunView`` representing the created run.
@@ -117,9 +117,11 @@ class RunsAPI:
117
117
  Raises:
118
118
  WherobotsAPIError: On HTTP or JSON-parsing failures.
119
119
  """
120
- params = {"region": region}
120
+ params = {}
121
+ if region:
122
+ params["region"] = region
121
123
  body = payload.to_dict()
122
- logger.info("Creating run '%s' in %s", payload.name, region)
124
+ logger.info("Creating run '%s' in %s", payload.name, region or "org default")
123
125
  response = self._client.post("/runs", params=params, json_body=body)
124
126
  return RunView.from_dict(self._parse_json(response))
125
127
 
wherobots/client.py CHANGED
@@ -58,7 +58,7 @@ class WherobotsJob:
58
58
  self,
59
59
  script: str,
60
60
  name: str,
61
- runtime: str | Runtime = "tiny",
61
+ runtime: str | Runtime | None = None,
62
62
  region: str | Region | None = None,
63
63
  api_key: str | None = None,
64
64
  version: str | None = None,
@@ -82,8 +82,19 @@ class WherobotsJob:
82
82
  script: Path to Python script (.py) or JAR file (.jar).
83
83
  Can be local path or S3 URI (s3://bucket/key)
84
84
  name: Job name (8-255 chars, alphanumeric, _, -, .)
85
- runtime: Compute runtime size (default: "tiny")
86
- region: AWS region (default: from config or env)
85
+ runtime: The compute runtime to use. Accepts a ``Runtime`` enum
86
+ value or a raw string; strings are passed to the API as-is.
87
+ Override the default runtime set for your organization — only
88
+ set this if you need a specific runtime instead of the one your
89
+ administrator has configured. When omitted, your organization's
90
+ default runtime is used.
91
+ region: The compute region to run in. Accepts a ``Region`` enum
92
+ value or a raw string (e.g. a BYOC region such as
93
+ ``byoc-acme-us-east-1``); strings are passed to the API as-is.
94
+ Override the default region set for your organization — only set
95
+ this if you intend to use a specific region instead of the one
96
+ your administrator has configured. When omitted, your
97
+ organization's default region is used.
87
98
  api_key: Wherobots API key (or set WHEROBOTS_API_KEY env var)
88
99
  version: Wherobots version ("latest" or "preview")
89
100
  timeout_seconds: Job timeout in seconds (default: 3600)
@@ -138,7 +149,9 @@ class WherobotsJob:
138
149
  request_timeout_seconds=request_timeout_seconds,
139
150
  )
140
151
 
141
- self.region = region_value or self._config.region or "aws-us-west-2"
152
+ # No hardcoded fallback: when neither the argument nor the config
153
+ # supplies a region, leave it unset so the API applies the org default.
154
+ self.region = region_value or self._config.region
142
155
  self.version = version or self._config.version
143
156
  self.timeout_seconds = timeout_seconds
144
157
  self.args = args or []
wherobots/models.py CHANGED
@@ -244,8 +244,8 @@ class RunJarPayload:
244
244
  class CreateRunPayload:
245
245
  """Full payload for ``POST /runs``."""
246
246
 
247
- runtime: str
248
247
  name: str
248
+ runtime: str | None = None
249
249
  version: str = "latest"
250
250
  timeout_seconds: int = 3600
251
251
  run_python: RunPythonPayload | None = None
@@ -259,11 +259,13 @@ class CreateRunPayload:
259
259
  Dict suitable for ``POST /runs`` request body.
260
260
  """
261
261
  d: dict[str, Any] = {
262
- "runtime": self.runtime,
263
262
  "name": self.name,
264
263
  "version": self.version,
265
264
  "timeoutSeconds": self.timeout_seconds,
266
265
  }
266
+ # Omit runtime when unset so the API applies the org default.
267
+ if self.runtime is not None:
268
+ d["runtime"] = self.runtime
267
269
  if self.run_python is not None:
268
270
  d["runPython"] = self.run_python.to_dict()
269
271
  if self.run_jar is not None:
@@ -296,7 +298,7 @@ class CreateRunPayload:
296
298
  if "environment" in data and data["environment"] is not None:
297
299
  environment = RunEnvironment.from_dict(data["environment"])
298
300
  return cls(
299
- runtime=data.get("runtime", ""),
301
+ runtime=data.get("runtime"),
300
302
  name=data.get("name", ""),
301
303
  version=data.get("version", "latest"),
302
304
  timeout_seconds=data.get("timeoutSeconds", 3600),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wherobots-python-sdk
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Summary: Python SDK for Wherobots (currently covers the Jobs REST API)
5
5
  Author-email: Wherobots <support@wherobots.com>
6
6
  License-Expression: Apache-2.0
@@ -130,7 +130,7 @@ The API key can also be set via the `WHEROBOTS_API_KEY` environment variable.
130
130
  | Variable | Description | Default |
131
131
  |------------------------------------|---------------------------------|--------------------------------------|
132
132
  | `WHEROBOTS_API_KEY` | API key | *(required)* |
133
- | `WHEROBOTS_REGION` | Default AWS region | `aws-us-west-2` |
133
+ | `WHEROBOTS_REGION` | Region override (else org default) | *(none — org default)* |
134
134
  | `WHEROBOTS_API_BASE_URL` | API base URL | `https://api.cloud.wherobots.com` |
135
135
  | `WHEROBOTS_VERSION` | Wherobots version | `latest` |
136
136
  | `WHEROBOTS_REQUEST_TIMEOUT_SECONDS`| HTTP request timeout (seconds) | `30` |
@@ -176,8 +176,8 @@ The primary class for managing job runs.
176
176
  WherobotsJob(
177
177
  script: str, # Path or S3 URI to .py or .jar
178
178
  name: str, # Job name (8-255 chars, [a-zA-Z0-9_\-.]+)
179
- runtime: str | Runtime = "tiny", # Compute size
180
- region: str | Region | None = None, # AWS region
179
+ runtime: str | Runtime | None = None, # Compute size (None -> org default)
180
+ region: str | Region | None = None, # Region; str passed as-is (None -> org default)
181
181
  api_key: str | None = None, # API key (or env var)
182
182
  version: str | None = None, # "latest" | "preview"
183
183
  timeout_seconds: int = 3600, # Job timeout
@@ -1,20 +1,20 @@
1
1
  wherobots/__init__.py,sha256=UGvPiw86dJwrZiA-7u-Nx4thyZj7QmdOio343-vscHg,1754
2
- wherobots/__version__.py,sha256=gdQx5awJ980s8gFK_3u0b4RogasTty0-FJ6cROVHjZo,111
3
- wherobots/client.py,sha256=go2-usZMWm74zUXupiy5k-M3Faprn_WJaH1wK0Sr0po,23467
2
+ wherobots/__version__.py,sha256=GAJEREHHe5JAT1ij0nfgyxgiAYBAL70NEq_SRLzkT0U,111
3
+ wherobots/client.py,sha256=LryXfcLWhYsgt7NaRF-Qkd5-tHXnSXNuX-viFsmWCK4,24427
4
4
  wherobots/config.py,sha256=Ib20Y5mGsE4aP_g99ZKEyZvV8q-aOXq7RVpYP8i0lpo,6679
5
5
  wherobots/enums.py,sha256=YsxXN3ZcY99aoEsUtjYs4otHDevsSPizAgCp-vShds8,4154
6
6
  wherobots/exceptions.py,sha256=ERoTU7Edf-dFCE4-ScyuEcC-2O2d5JRa8issQWc-PNA,1296
7
- wherobots/models.py,sha256=RKmxMpHTLzhOdb3FcvxWLgrxjpSCBpuc9l-BacbqLl4,35673
7
+ wherobots/models.py,sha256=05hz8g163sBtc750uxgxD5amEJ76SiyC8ZCcy7WXad4,35793
8
8
  wherobots/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  wherobots/api/__init__.py,sha256=jUb587jazP_FA-sH_6yCYfvGxsNiUOyIYAPb3CHOYtQ,218
10
10
  wherobots/api/base.py,sha256=IiT3k17G19bT0rM2zYZs9Tpob8pgTrSLAWdKlLUVM1o,8769
11
11
  wherobots/api/files.py,sha256=c2yGQ-yQKzvp1O-47JrFp1H6Uj7FDCBRiyJ0ym8g-TE,14040
12
- wherobots/api/runs.py,sha256=25Hz0evE0gfu7YCQma77AcxAbrk89iKgzdoE0XFJr7U,8442
12
+ wherobots/api/runs.py,sha256=ef5ouPGUsuaIIpBW3sHjkOXxfxTuOA6ieFjkMIuNAyc,8542
13
13
  wherobots/utils/__init__.py,sha256=cTM2QNJDauQWyGBTJPE5yH4ULc4Ucg_4KFzemjM3HaA,193
14
14
  wherobots/utils/logger.py,sha256=eclhD9Vf2LsSm4engRzT3jE2v0wdHJH01OfeI3ml4HM,1103
15
15
  wherobots/utils/validation.py,sha256=R0iG4OqzER4prdP8-TOQV_pQFJ3emEQyWYYuc3aCefU,890
16
- wherobots_python_sdk-0.1.0.dist-info/licenses/LICENSE,sha256=U1EH466XmvxbqaWOY0cax49w0R87_6w6yJLyV14v4bc,10767
17
- wherobots_python_sdk-0.1.0.dist-info/METADATA,sha256=EH_LfjKliEImWBAi3a2t2a5HvbvokyzpIsqV0p-jqWI,21512
18
- wherobots_python_sdk-0.1.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
19
- wherobots_python_sdk-0.1.0.dist-info/top_level.txt,sha256=oL-n-9GIG0rmUeukuytUqdN6yfROIsVh8bNrgZsOdxw,10
20
- wherobots_python_sdk-0.1.0.dist-info/RECORD,,
16
+ wherobots_python_sdk-0.2.0.dist-info/licenses/LICENSE,sha256=U1EH466XmvxbqaWOY0cax49w0R87_6w6yJLyV14v4bc,10767
17
+ wherobots_python_sdk-0.2.0.dist-info/METADATA,sha256=7mfRAWH5Ol3gyVCB9e83Ya426mwDDEcKjo6XVD8_IjU,21572
18
+ wherobots_python_sdk-0.2.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
19
+ wherobots_python_sdk-0.2.0.dist-info/top_level.txt,sha256=oL-n-9GIG0rmUeukuytUqdN6yfROIsVh8bNrgZsOdxw,10
20
+ wherobots_python_sdk-0.2.0.dist-info/RECORD,,