4
4
from typing import Optional
5
5
6
6
CLUSTER_NAME_PLACEHOLDER = "\\ {{CLUSTER_NAME}}"
7
- DAFT_VERSION_PLACEHOLDER = "\\ {{DAFT_VERSION }}"
7
+ DAFT_INSTALL_PLACEHOLDER = "\\ {{DAFT_INSTALL }}"
8
8
PYTHON_VERSION_PLACEHOLDER = "\\ {{PYTHON_VERSION}}"
9
9
CLUSTER_PROFILE__NODE_COUNT = "\\ {{CLUSTER_PROFILE/node_count}}"
10
10
CLUSTER_PROFILE__INSTANCE_TYPE = "\\ {{CLUSTER_PROFILE/instance_type}}"
@@ -51,6 +51,7 @@ class Profile:
51
51
52
52
parser = ArgumentParser ()
53
53
parser .add_argument ("--cluster-name" )
54
+ parser .add_argument ("--daft-wheel-url" )
54
55
parser .add_argument ("--daft-version" )
55
56
parser .add_argument ("--python-version" )
56
57
parser .add_argument ("--cluster-profile" )
@@ -59,10 +60,17 @@ class Profile:
59
60
if args .cluster_name :
60
61
content = content .replace (CLUSTER_NAME_PLACEHOLDER , args .cluster_name )
61
62
62
- if args .daft_version :
63
- content = content .replace (DAFT_VERSION_PLACEHOLDER , f"=={ args .daft_version } " )
63
+ if args .daft_wheel_url and args .daft_version :
64
+ raise Exception (
65
+ "Cannot specify both the `daft-wheel-name` and the `daft-version`; please choose one or the other"
66
+ )
67
+ elif args .daft_wheel_url :
68
+ daft_install = args .daft_wheel_url
69
+ elif args .daft_version :
70
+ daft_install = f"getdaft=={ args .daft_version } "
64
71
else :
65
- content = content .replace (DAFT_VERSION_PLACEHOLDER , "" )
72
+ daft_install = "getdaft"
73
+ content = content .replace (DAFT_INSTALL_PLACEHOLDER , daft_install )
66
74
67
75
if args .python_version :
68
76
content = content .replace (PYTHON_VERSION_PLACEHOLDER , args .python_version )
0 commit comments