12
12
from typing import Any
13
13
14
14
SUPPORTED_PYTHON_VERSIONS = ["3.10" , "3.11" ]
15
- SUPPORTED_PLATFORMS = [
16
- "win_amd64" ,
17
- "manylinux2014_x86_64" ,
18
- "macosx_10_9_x86_64" ,
19
- "macosx_11_0_arm64" ,
20
- ]
21
15
NATIVE_DEPENDENCIES = ["xxhash" ]
22
- FINAL_BUNDLE_NAMES = [
23
- "deadline_cloud_for_blender_submitter-deps-windows.zip" ,
24
- "deadline_cloud_for_blender_submitter-deps-linux.zip" ,
25
- "deadline_cloud_for_blender_submitter-deps-macos-intel.zip" ,
26
- "deadline_cloud_for_blender_submitter-deps-macos-arm64.zip" ,
27
- ]
28
16
29
17
30
18
def _get_project_dict () -> dict [str , Any ]:
@@ -33,7 +21,7 @@ def _get_project_dict() -> dict[str, Any]:
33
21
toml_install_pip_args = ["pip" , "install" , "--target" , toml_env , "toml" ]
34
22
subprocess .run (toml_install_pip_args , check = True )
35
23
sys .path .insert (0 , toml_env )
36
- import toml
24
+ import toml # type: ignore
37
25
mode = "r"
38
26
else :
39
27
import tomllib as toml
@@ -92,25 +80,20 @@ def _download_native_dependencies(working_directory: Path, base_env: Path) -> li
92
80
]
93
81
native_dependency_paths = []
94
82
for version in SUPPORTED_PYTHON_VERSIONS :
95
- for platform in SUPPORTED_PLATFORMS :
96
- native_dependency_path = (
97
- working_directory / "native" / f"{ version .replace ('.' , '_' )} _{ platform } "
98
- )
99
- native_dependency_paths .append (native_dependency_path )
100
- native_dependency_path .mkdir (parents = True )
101
- native_dependency_pip_args = [
102
- "pip" ,
103
- "install" ,
104
- "--target" ,
105
- str (native_dependency_path ),
106
- "--platform" ,
107
- platform ,
108
- "--python-version" ,
109
- version ,
110
- "--only-binary=:all:" ,
111
- * versioned_native_dependencies ,
112
- ]
113
- subprocess .run (native_dependency_pip_args , check = True )
83
+ native_dependency_path = working_directory / "native" / f"{ version .replace ('.' , '_' )} "
84
+ native_dependency_paths .append (native_dependency_path )
85
+ native_dependency_path .mkdir (parents = True )
86
+ native_dependency_pip_args = [
87
+ "pip" ,
88
+ "install" ,
89
+ "--target" ,
90
+ str (native_dependency_path ),
91
+ "--python-version" ,
92
+ version ,
93
+ "--only-binary=:all:" ,
94
+ * versioned_native_dependencies ,
95
+ ]
96
+ subprocess .run (native_dependency_pip_args , check = True )
114
97
return native_dependency_paths
115
98
116
99
@@ -151,19 +134,9 @@ def _copy_zip_to_destination(zip_path: Path) -> Path:
151
134
return zip_destination
152
135
153
136
154
- def _remove_old_bundles (zip_destination : Path ):
155
- for file in FINAL_BUNDLE_NAMES :
156
- Path (zip_destination .parent / file ).unlink (missing_ok = True )
157
-
158
-
159
- def _rename_bundles_to_final_names (zip_destination : Path ):
160
- for file in FINAL_BUNDLE_NAMES :
161
- shutil .copy (zip_destination , zip_destination .parent / file )
162
-
163
-
164
137
def build_deps_bundle () -> None :
165
- with TemporaryDirectory () as working_directory :
166
- working_directory = Path (working_directory )
138
+ with TemporaryDirectory () as wd :
139
+ working_directory = Path (wd )
167
140
project_dict = _get_project_dict ()
168
141
dependencies = _get_dependencies (project_dict )
169
142
base_env = _build_base_environment (working_directory , dependencies )
@@ -172,9 +145,7 @@ def build_deps_bundle() -> None:
172
145
zip_path = _get_zip_path (working_directory , project_dict )
173
146
_zip_bundle (base_env , zip_path )
174
147
print (list (working_directory .glob ("*" )))
175
- zip_destination = _copy_zip_to_destination (zip_path )
176
- _remove_old_bundles (zip_destination )
177
- _rename_bundles_to_final_names (zip_destination )
148
+ _copy_zip_to_destination (zip_path )
178
149
179
150
180
151
if __name__ == "__main__" :
0 commit comments