Skip to content

Commit c3c2ec3

Browse files
committed
new deployment status routes
1 parent cbc2a85 commit c3c2ec3

File tree

4 files changed

+19
-7
lines changed

4 files changed

+19
-7
lines changed

roboflow/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from roboflow.core.project import Project
99
from roboflow.core.workspace import Workspace
1010

11-
__version__ = "0.2.24"
11+
__version__ = "0.2.25"
1212

1313

1414
def check_key(api_key, model, notebook, num_retries=0):

roboflow/core/project.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ def versions(self):
9393
local=None,
9494
workspace=self.__workspace,
9595
project=self.__project_name,
96+
public=self.public
9697
)
9798
version_array.append(version_object)
9899
return version_array
@@ -251,6 +252,7 @@ def version(self, version_number, local=None):
251252
local=local,
252253
workspace=self.__workspace,
253254
project=self.__project_name,
255+
public=self.public,
254256
)
255257
return vers
256258

roboflow/core/version.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def __init__(
4141
local,
4242
workspace,
4343
project,
44+
public,
4445
):
4546
if api_key in DEMO_KEYS:
4647
if api_key == "coco-128-sample":
@@ -72,6 +73,7 @@ def __init__(
7273
self.model_format = model_format
7374
self.workspace = workspace
7475
self.project = project
76+
self.public = public
7577
if "exports" in version_dict.keys():
7678
self.exports = version_dict["exports"]
7779
else:
@@ -367,12 +369,18 @@ def deploy(self, model_type: str, model_path: str) -> None:
367369
try:
368370
res.raise_for_status()
369371

370-
print(
371-
f"View the status of your deployment at: {APP_URL}/{self.workspace}/{self.project}/{self.version}"
372-
)
373-
print(
374-
f"Share your model with the world at: {UNIVERSE_URL}/{self.workspace}/{self.project}/{self.version}"
375-
)
372+
if self.public:
373+
print(
374+
f"View the status of your deployment at: {APP_URL}/{self.workspace}/{self.project}/deploy/{self.version}"
375+
)
376+
print(
377+
f"Share your model with the world at: {UNIVERSE_URL}/{self.workspace}/{self.project}/model/{self.version}"
378+
)
379+
else:
380+
print(
381+
f"View the status of your deployment at: {APP_URL}/{self.workspace}/{self.project}/deploy/{self.version}"
382+
)
383+
376384
except Exception as e:
377385
print(f"An error occured when uploading the model: {e}")
378386

tests/helpers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
def get_version(
66
api_key="test-api-key",
77
project_name="Test Project Name",
8+
public=True,
89
version_number="1",
910
type=TYPE_OBJECT_DETECTION,
1011
workspace_name="Test Workspace Name",
@@ -46,4 +47,5 @@ def get_version(
4647
local=None,
4748
workspace=workspace_name,
4849
project=project_name,
50+
public=public
4951
)

0 commit comments

Comments
 (0)