Skip to content

Commit b5495c1

Browse files
Merge pull request #95 from roboflow/deploy-follow
New Deployment Status Routes
2 parents d7f3087 + f07a804 commit b5495c1

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

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:
@@ -372,12 +374,18 @@ def deploy(self, model_type: str, model_path: str) -> None:
372374
try:
373375
res.raise_for_status()
374376

375-
print(
376-
f"View the status of your deployment at: {APP_URL}/{self.workspace}/{self.project}/{self.version}"
377-
)
378-
print(
379-
f"Share your model with the world at: {UNIVERSE_URL}/{self.workspace}/{self.project}/{self.version}"
380-
)
377+
if self.public:
378+
print(
379+
f"View the status of your deployment at: {APP_URL}/{self.workspace}/{self.project}/deploy/{self.version}"
380+
)
381+
print(
382+
f"Share your model with the world at: {UNIVERSE_URL}/{self.workspace}/{self.project}/model/{self.version}"
383+
)
384+
else:
385+
print(
386+
f"View the status of your deployment at: {APP_URL}/{self.workspace}/{self.project}/deploy/{self.version}"
387+
)
388+
381389
except Exception as e:
382390
print(f"An error occured when uploading the model: {e}")
383391

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)