supervisely 6.73.295__py3-none-any.whl → 6.73.296__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.
Potentially problematic release.
This version of supervisely might be problematic. Click here for more details.
- supervisely/cli/release/run.py +34 -51
- {supervisely-6.73.295.dist-info → supervisely-6.73.296.dist-info}/METADATA +1 -1
- {supervisely-6.73.295.dist-info → supervisely-6.73.296.dist-info}/RECORD +7 -7
- {supervisely-6.73.295.dist-info → supervisely-6.73.296.dist-info}/LICENSE +0 -0
- {supervisely-6.73.295.dist-info → supervisely-6.73.296.dist-info}/WHEEL +0 -0
- {supervisely-6.73.295.dist-info → supervisely-6.73.296.dist-info}/entry_points.txt +0 -0
- {supervisely-6.73.295.dist-info → supervisely-6.73.296.dist-info}/top_level.txt +0 -0
supervisely/cli/release/run.py
CHANGED
|
@@ -1,33 +1,41 @@
|
|
|
1
|
-
from pathlib import Path
|
|
2
|
-
import sys
|
|
3
|
-
import os
|
|
4
1
|
import json
|
|
5
|
-
import
|
|
6
|
-
import click
|
|
2
|
+
import os
|
|
7
3
|
import re
|
|
8
4
|
import subprocess
|
|
5
|
+
import sys
|
|
6
|
+
import traceback
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
|
|
9
|
+
import click
|
|
9
10
|
import git
|
|
10
11
|
from dotenv import load_dotenv
|
|
11
12
|
from rich.console import Console
|
|
12
13
|
|
|
13
|
-
|
|
14
14
|
MIN_SUPPORTED_INSTANCE_VERSION = "6.8.3"
|
|
15
15
|
|
|
16
|
+
from supervisely._utils import setup_certificates
|
|
16
17
|
from supervisely.cli.release.release import (
|
|
18
|
+
delete_tag,
|
|
17
19
|
find_tag_in_repo,
|
|
18
|
-
push_tag,
|
|
19
20
|
get_app_from_instance,
|
|
20
|
-
get_module_root,
|
|
21
|
-
get_module_path,
|
|
22
21
|
get_appKey,
|
|
23
|
-
|
|
24
|
-
slug_is_valid,
|
|
25
|
-
delete_tag,
|
|
22
|
+
get_created_at,
|
|
26
23
|
get_instance_version,
|
|
24
|
+
get_module_path,
|
|
25
|
+
get_module_root,
|
|
27
26
|
get_user,
|
|
28
|
-
|
|
27
|
+
push_tag,
|
|
28
|
+
release,
|
|
29
|
+
slug_is_valid,
|
|
29
30
|
)
|
|
30
31
|
|
|
32
|
+
load_dotenv(os.path.expanduser("~/supervisely.env"))
|
|
33
|
+
try:
|
|
34
|
+
setup_certificates()
|
|
35
|
+
except Exception as e:
|
|
36
|
+
print(f"Error setting up certificates: {e}")
|
|
37
|
+
traceback.print_exc()
|
|
38
|
+
|
|
31
39
|
|
|
32
40
|
def _check_git(repo: git.Repo):
|
|
33
41
|
console = Console()
|
|
@@ -39,11 +47,7 @@ def _check_git(repo: git.Repo):
|
|
|
39
47
|
)
|
|
40
48
|
console.print(" Untracked files:")
|
|
41
49
|
console.print(
|
|
42
|
-
"\n".join(
|
|
43
|
-
[f" {i+1}) " + file for i, file in enumerate(repo.untracked_files)][
|
|
44
|
-
:20
|
|
45
|
-
]
|
|
46
|
-
)
|
|
50
|
+
"\n".join([f" {i+1}) " + file for i, file in enumerate(repo.untracked_files)][:20])
|
|
47
51
|
)
|
|
48
52
|
if len(repo.untracked_files) > 20:
|
|
49
53
|
console.print(f" ... and {len(repo.untracked_files) - 20} more.")
|
|
@@ -98,17 +102,13 @@ def _ask_release_version(repo: git.Repo):
|
|
|
98
102
|
console = Console()
|
|
99
103
|
|
|
100
104
|
def extract_version(tag_name):
|
|
101
|
-
return tag_name[len("sly-release-"):] if tag_name.startswith("sly-release-") else tag_name
|
|
105
|
+
return tag_name[len("sly-release-") :] if tag_name.startswith("sly-release-") else tag_name
|
|
102
106
|
|
|
103
107
|
try:
|
|
104
108
|
sly_release_tags = [
|
|
105
|
-
tag.name
|
|
106
|
-
for tag in repo.tags
|
|
107
|
-
if _check_release_version(extract_version(tag.name))
|
|
109
|
+
tag.name for tag in repo.tags if _check_release_version(extract_version(tag.name))
|
|
108
110
|
]
|
|
109
|
-
sly_release_tags.sort(
|
|
110
|
-
key=lambda tag: [int(n) for n in extract_version(tag)[1:].split(".")]
|
|
111
|
-
)
|
|
111
|
+
sly_release_tags.sort(key=lambda tag: [int(n) for n in extract_version(tag)[1:].split(".")])
|
|
112
112
|
current_release_version = extract_version(sly_release_tags[-1])[1:]
|
|
113
113
|
suggested_release_version = ".".join(
|
|
114
114
|
[
|
|
@@ -232,9 +232,7 @@ def run(
|
|
|
232
232
|
# get module path and check if it is a git repo
|
|
233
233
|
module_root = get_module_root(app_directory)
|
|
234
234
|
if sub_app_directory is not None:
|
|
235
|
-
sub_app_directory = (
|
|
236
|
-
Path(sub_app_directory).absolute().relative_to(module_root).as_posix()
|
|
237
|
-
)
|
|
235
|
+
sub_app_directory = Path(sub_app_directory).absolute().relative_to(module_root).as_posix()
|
|
238
236
|
module_path = get_module_path(module_root, sub_app_directory)
|
|
239
237
|
try:
|
|
240
238
|
repo = git.Repo(module_root)
|
|
@@ -244,8 +242,7 @@ def run(
|
|
|
244
242
|
)
|
|
245
243
|
return False
|
|
246
244
|
|
|
247
|
-
#
|
|
248
|
-
load_dotenv(os.path.expanduser("~/supervisely.env"))
|
|
245
|
+
# load server address
|
|
249
246
|
server_address = os.getenv("SERVER_ADDRESS", None)
|
|
250
247
|
if server_address is None:
|
|
251
248
|
console.print(
|
|
@@ -314,9 +311,7 @@ def run(
|
|
|
314
311
|
with open(module_path.joinpath("config.json"), "r") as f:
|
|
315
312
|
config = json.load(f)
|
|
316
313
|
except FileNotFoundError:
|
|
317
|
-
console.print(
|
|
318
|
-
f'[red][Error][/] Cannot find "config.json" file at "{module_path}"'
|
|
319
|
-
)
|
|
314
|
+
console.print(f'[red][Error][/] Cannot find "config.json" file at "{module_path}"')
|
|
320
315
|
return False
|
|
321
316
|
except json.JSONDecodeError as e:
|
|
322
317
|
console.print(
|
|
@@ -379,9 +374,7 @@ def run(
|
|
|
379
374
|
f'[red][Error][/] Could not access "{server_address}". Check that instance is running and accessible'
|
|
380
375
|
)
|
|
381
376
|
return False
|
|
382
|
-
module_exists_label =
|
|
383
|
-
"[yellow bold]updated[/]" if app_exist else "[green bold]created[/]"
|
|
384
|
-
)
|
|
377
|
+
module_exists_label = "[yellow bold]updated[/]" if app_exist else "[green bold]created[/]"
|
|
385
378
|
|
|
386
379
|
# print details
|
|
387
380
|
console.print(f"Application directory:\t[green]{module_path}[/]")
|
|
@@ -390,9 +383,7 @@ def run(
|
|
|
390
383
|
console.print(f"User:\t\t\t[green]{user_login} (id: {user_id})[/]")
|
|
391
384
|
if release_token:
|
|
392
385
|
console.print(f"Release token:\t\t[green]{hided(release_token)}[/]")
|
|
393
|
-
console.print(
|
|
394
|
-
f"Release User: \t\t[green]{release_user_login} (id: {release_user_id})[/]"
|
|
395
|
-
)
|
|
386
|
+
console.print(f"Release User: \t\t[green]{release_user_login} (id: {release_user_id})[/]")
|
|
396
387
|
console.print(f"Git branch:\t\t[green]{repo.active_branch}[/]")
|
|
397
388
|
console.print(f"App Name:\t\t[green]{app_name}[/]")
|
|
398
389
|
console.print(f"App Key:\t\t[green]{hided(appKey)}[/]\n")
|
|
@@ -411,14 +402,10 @@ def run(
|
|
|
411
402
|
if release_version is None:
|
|
412
403
|
release_version = _ask_release_version(repo)
|
|
413
404
|
if not _check_release_version(release_version):
|
|
414
|
-
console.print(
|
|
415
|
-
'[red][Error][/] Incorrect release version. Should be of format "vX.X.X"'
|
|
416
|
-
)
|
|
405
|
+
console.print('[red][Error][/] Incorrect release version. Should be of format "vX.X.X"')
|
|
417
406
|
return False
|
|
418
407
|
else:
|
|
419
|
-
console.print(
|
|
420
|
-
f'Release version will be "{repo.active_branch.name}" as the branch name'
|
|
421
|
-
)
|
|
408
|
+
console.print(f'Release version will be "{repo.active_branch.name}" as the branch name')
|
|
422
409
|
release_version = repo.active_branch.name
|
|
423
410
|
|
|
424
411
|
# get release name
|
|
@@ -534,9 +521,7 @@ def run(
|
|
|
534
521
|
return True
|
|
535
522
|
|
|
536
523
|
|
|
537
|
-
@click.command(
|
|
538
|
-
help="This app allows you to release your aplication to Supervisely platform"
|
|
539
|
-
)
|
|
524
|
+
@click.command(help="This app allows you to release your aplication to Supervisely platform")
|
|
540
525
|
@click.option(
|
|
541
526
|
"-p",
|
|
542
527
|
"--path",
|
|
@@ -554,9 +539,7 @@ def run(
|
|
|
554
539
|
required=False,
|
|
555
540
|
help='[Optional] Release version in format "vX.X.X"',
|
|
556
541
|
)
|
|
557
|
-
@click.option(
|
|
558
|
-
"--release-description", required=False, help="[Optional] Release description"
|
|
559
|
-
)
|
|
542
|
+
@click.option("--release-description", required=False, help="[Optional] Release description")
|
|
560
543
|
@click.option(
|
|
561
544
|
"--share",
|
|
562
545
|
is_flag=True,
|
|
@@ -550,7 +550,7 @@ supervisely/cli/project/project_get.py,sha256=RWnMxuKd_WWhUlA5QEqI_9d4N6x8VDq0ta
|
|
|
550
550
|
supervisely/cli/project/project_upload.py,sha256=qA_0ktOpJxUUa_Hliwvny8-uIYDQBiuzHMq8nufbLd4,1416
|
|
551
551
|
supervisely/cli/release/__init__.py,sha256=5aDijgIIDsKFZVayq8anvv5ynWKhC4LZqAdESTKCW2c,335
|
|
552
552
|
supervisely/cli/release/release.py,sha256=OtAi9g_2kvjp5lx4aiTE0JxczzJcaBtDFpHR-rHWFpE,9308
|
|
553
|
-
supervisely/cli/release/run.py,sha256=
|
|
553
|
+
supervisely/cli/release/run.py,sha256=nuFh9mVFcrUlB4PWagMEC6iUIa7nA2pMiM_CC1IZ42M,19814
|
|
554
554
|
supervisely/cli/task/__init__.py,sha256=n0ofJDqX3AMvvTz1umfBDfEUPDFzk5Htve3nnZFd7fs,67
|
|
555
555
|
supervisely/cli/task/task_set.py,sha256=KIGJ-X0iB7DzX3Ig8720FJh1WpohTVkkPk8HZt2rIzM,1337
|
|
556
556
|
supervisely/cli/teamfiles/__init__.py,sha256=1V9ZFo8-xVOjFFJr7siJx2VAv-F0m44cxMEm5ZEU0Ww,251
|
|
@@ -1070,9 +1070,9 @@ supervisely/worker_proto/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
|
|
|
1070
1070
|
supervisely/worker_proto/worker_api_pb2.py,sha256=VQfi5JRBHs2pFCK1snec3JECgGnua3Xjqw_-b3aFxuM,59142
|
|
1071
1071
|
supervisely/worker_proto/worker_api_pb2_grpc.py,sha256=3BwQXOaP9qpdi0Dt9EKG--Lm8KGN0C5AgmUfRv77_Jk,28940
|
|
1072
1072
|
supervisely_lib/__init__.py,sha256=7-3QnN8Zf0wj8NCr2oJmqoQWMKKPKTECvjH9pd2S5vY,159
|
|
1073
|
-
supervisely-6.73.
|
|
1074
|
-
supervisely-6.73.
|
|
1075
|
-
supervisely-6.73.
|
|
1076
|
-
supervisely-6.73.
|
|
1077
|
-
supervisely-6.73.
|
|
1078
|
-
supervisely-6.73.
|
|
1073
|
+
supervisely-6.73.296.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
1074
|
+
supervisely-6.73.296.dist-info/METADATA,sha256=jw6IjeK21DXTFEgbISalLDxHn7BWvWAQkZ3rbhAMJ5g,33573
|
|
1075
|
+
supervisely-6.73.296.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
|
1076
|
+
supervisely-6.73.296.dist-info/entry_points.txt,sha256=U96-5Hxrp2ApRjnCoUiUhWMqijqh8zLR03sEhWtAcms,102
|
|
1077
|
+
supervisely-6.73.296.dist-info/top_level.txt,sha256=kcFVwb7SXtfqZifrZaSE3owHExX4gcNYe7Q2uoby084,28
|
|
1078
|
+
supervisely-6.73.296.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|