supervisely 6.73.380__py3-none-any.whl → 6.73.381__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.
@@ -160,6 +160,7 @@ def upload_archive(
160
160
  user_id,
161
161
  subapp_path,
162
162
  share_app,
163
+ files,
163
164
  ):
164
165
  f = open(archive_path, "rb")
165
166
  archive_name = os.path.basename(archive_path)
@@ -182,6 +183,13 @@ def upload_archive(
182
183
  fields["userId"] = str(user_id)
183
184
  if share_app:
184
185
  fields["isShared"] = "true"
186
+ if files:
187
+ files_contents = {}
188
+ fields["files"] = files_contents
189
+ for file_name, file_path in files.items():
190
+ files_contents[file_name] = Path(file_path).read_text(encoding="utf-8")
191
+ fields["files"] = json.dumps(files_contents)
192
+
185
193
  e = MultipartEncoder(fields=fields)
186
194
  encoder_len = e.len
187
195
  with tqdm(
@@ -293,6 +301,7 @@ def release(
293
301
  subapp_path="",
294
302
  created_at=None,
295
303
  share_app=False,
304
+ files=None,
296
305
  ):
297
306
  if created_at is None:
298
307
  created_at = get_created_at(repo, release_version)
@@ -317,6 +326,7 @@ def release(
317
326
  user_id,
318
327
  subapp_path,
319
328
  share_app,
329
+ files,
320
330
  )
321
331
  finally:
322
332
  delete_directory(os.path.dirname(archive_path))
@@ -347,6 +347,14 @@ def run(
347
347
  with open(modal_template_path, "r") as f:
348
348
  modal_template = f.read()
349
349
 
350
+ # get files
351
+ files = config.get("files", None)
352
+ if files is not None:
353
+ files = files.copy()
354
+ for file_name, file_path in files.items():
355
+ file_path = str(module_root.joinpath(file_path).absolute())
356
+ files[file_name] = file_path
357
+
350
358
  # check that everything is commited and pushed
351
359
  success = _check_git(repo)
352
360
  if not success:
@@ -476,6 +484,7 @@ def run(
476
484
  sub_app_directory if sub_app_directory != None else "",
477
485
  created_at,
478
486
  share_app,
487
+ files,
479
488
  )
480
489
  if response.status_code != 200:
481
490
  error = f"[red][Error][/] Error releasing the application. Please contact Supervisely team. Status Code: {response.status_code}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: supervisely
3
- Version: 6.73.380
3
+ Version: 6.73.381
4
4
  Summary: Supervisely Python SDK.
5
5
  Home-page: https://github.com/supervisely/supervisely
6
6
  Author: Supervisely
@@ -563,8 +563,8 @@ supervisely/cli/project/project_download.py,sha256=dEznxE_MhLTYbU9KBbdmw-Ria1Knh
563
563
  supervisely/cli/project/project_get.py,sha256=RWnMxuKd_WWhUlA5QEqI_9d4N6x8VDq0taPTWB8nxXc,689
564
564
  supervisely/cli/project/project_upload.py,sha256=qA_0ktOpJxUUa_Hliwvny8-uIYDQBiuzHMq8nufbLd4,1416
565
565
  supervisely/cli/release/__init__.py,sha256=5aDijgIIDsKFZVayq8anvv5ynWKhC4LZqAdESTKCW2c,335
566
- supervisely/cli/release/release.py,sha256=OtAi9g_2kvjp5lx4aiTE0JxczzJcaBtDFpHR-rHWFpE,9308
567
- supervisely/cli/release/run.py,sha256=nuFh9mVFcrUlB4PWagMEC6iUIa7nA2pMiM_CC1IZ42M,19814
566
+ supervisely/cli/release/release.py,sha256=tyAMZdTKXCnzq5yOHHkuk-iC1EgrMRuWynz_hDZLtx0,9626
567
+ supervisely/cli/release/run.py,sha256=bW_d-oengvwTbJBhbhIM0eAh6vL8TD2LIA8kMeJ_REM,20107
568
568
  supervisely/cli/task/__init__.py,sha256=n0ofJDqX3AMvvTz1umfBDfEUPDFzk5Htve3nnZFd7fs,67
569
569
  supervisely/cli/task/task_set.py,sha256=KIGJ-X0iB7DzX3Ig8720FJh1WpohTVkkPk8HZt2rIzM,1337
570
570
  supervisely/cli/teamfiles/__init__.py,sha256=1V9ZFo8-xVOjFFJr7siJx2VAv-F0m44cxMEm5ZEU0Ww,251
@@ -1103,9 +1103,9 @@ supervisely/worker_proto/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
1103
1103
  supervisely/worker_proto/worker_api_pb2.py,sha256=VQfi5JRBHs2pFCK1snec3JECgGnua3Xjqw_-b3aFxuM,59142
1104
1104
  supervisely/worker_proto/worker_api_pb2_grpc.py,sha256=3BwQXOaP9qpdi0Dt9EKG--Lm8KGN0C5AgmUfRv77_Jk,28940
1105
1105
  supervisely_lib/__init__.py,sha256=7-3QnN8Zf0wj8NCr2oJmqoQWMKKPKTECvjH9pd2S5vY,159
1106
- supervisely-6.73.380.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
1107
- supervisely-6.73.380.dist-info/METADATA,sha256=CzUiN8OFu7oIhsIVfHs1IE7oEX-DXrxALa7o1LkYjss,35154
1108
- supervisely-6.73.380.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
1109
- supervisely-6.73.380.dist-info/entry_points.txt,sha256=U96-5Hxrp2ApRjnCoUiUhWMqijqh8zLR03sEhWtAcms,102
1110
- supervisely-6.73.380.dist-info/top_level.txt,sha256=kcFVwb7SXtfqZifrZaSE3owHExX4gcNYe7Q2uoby084,28
1111
- supervisely-6.73.380.dist-info/RECORD,,
1106
+ supervisely-6.73.381.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
1107
+ supervisely-6.73.381.dist-info/METADATA,sha256=UUnBYUyuvA92UG865-LScbY3-NPG-QC8nGKPK8kU_kU,35154
1108
+ supervisely-6.73.381.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
1109
+ supervisely-6.73.381.dist-info/entry_points.txt,sha256=U96-5Hxrp2ApRjnCoUiUhWMqijqh8zLR03sEhWtAcms,102
1110
+ supervisely-6.73.381.dist-info/top_level.txt,sha256=kcFVwb7SXtfqZifrZaSE3owHExX4gcNYe7Q2uoby084,28
1111
+ supervisely-6.73.381.dist-info/RECORD,,