@@ -49,7 +49,7 @@ def nex_gen_command() -> list[str]:
4949 return [bin_path ]
5050
5151 if shutil .which ("nex-gen" ) is None :
52- subprocess .check_call (["cargo" , "install" , "--locked" , "nex-gen" ])
52+ subprocess .check_call (["cargo" , "install" , "--locked" , "nex-gen" , "--force" ])
5353 return ["nex-gen" ]
5454
5555
@@ -113,30 +113,6 @@ def generate_workflow_exports() -> None:
113113 workflow_init_path .write_text (content [:start ] + "" .join (all_block ) + content [end :])
114114
115115
116- def prepare_wit_workspace (temp_dir : Path ) -> tuple [Path , Path ]:
117- workspace_input_dir = temp_dir / "nexus"
118- shutil .copytree (wit_input_dir , workspace_input_dir )
119-
120- model_path = workspace_input_dir / "deps" / "nexus-temporal-types" / "model.wit"
121- model_content = model_path .read_text ()
122- if "@nexus.support" not in model_content :
123- support_path = (
124- workspace_input_dir
125- / "deps"
126- / "nexus-temporal-types"
127- / "python"
128- / python_support_path .name
129- )
130- support_path .parent .mkdir (parents = True , exist_ok = True )
131- shutil .copy2 (python_support_path , support_path )
132- model_path .write_text (
133- '/// @nexus.support python="python/temporal_model_converters.py"\n '
134- + model_content
135- )
136-
137- return workspace_input_dir / "workflow-service.wit" , workspace_input_dir / "deps"
138-
139-
140116def generate_nexus_system_api () -> None :
141117 if not wit_path .exists ():
142118 raise RuntimeError (f"missing WIT source: { wit_path } " )
@@ -146,9 +122,7 @@ def generate_nexus_system_api() -> None:
146122 raise RuntimeError (f"missing Python support source: { python_support_path } " )
147123
148124 with tempfile .TemporaryDirectory (dir = base_dir ) as temp_dir :
149- temp_path = Path (temp_dir )
150- descriptor_path = temp_path / "temporal_api.bin"
151- workspace_wit_path , workspace_wit_deps_dir = prepare_wit_workspace (temp_path )
125+ descriptor_path = Path (temp_dir ) / "temporal_api.bin"
152126 build_descriptor_set (descriptor_path )
153127 command = nex_gen_command ()
154128
@@ -161,9 +135,11 @@ def generate_nexus_system_api() -> None:
161135 "--lang" ,
162136 "python" ,
163137 "--input" ,
164- str (workspace_wit_path ),
138+ str (wit_path ),
165139 "--input" ,
166- str (workspace_wit_deps_dir ),
140+ str (wit_deps_dir ),
141+ "--support-file" ,
142+ str (python_support_path ),
167143 "--descriptors" ,
168144 str (descriptor_path ),
169145 "--output" ,
0 commit comments