@@ -91,6 +91,12 @@ def build(
91
91
find_links : Optional [str ] = typer .Option (
92
92
None , "--find-links" , "-f" , help = "Extra index url to use when downloading dependencies"
93
93
),
94
+ only_extra_platforms : Optional [bool ] = typer .Option (
95
+ False ,
96
+ "--only-extra-platforms" ,
97
+ "-o" ,
98
+ help = "Only build for the extra platforms, useful when building from arm64 (mac)" ,
99
+ ),
94
100
):
95
101
"""
96
102
Builds and signs an extension using the developer fused key-certificate
@@ -103,6 +109,7 @@ def build(
103
109
:param extra_platforms: Attempt to also download wheels for an extra platform (e.g. manylinux1_x86_64 or win_amd64)
104
110
:param extra_index_url: Extra index url to use when downloading dependencies
105
111
:param find_links: Extra index url to use when downloading dependencies
112
+ :param only_extra_platforms: If true, only build for the extra platforms, useful when building from arm64
106
113
"""
107
114
console .print (f"Building and signing extension from { extension_dir } to { target_directory } " , style = "cyan" )
108
115
if target_directory is None :
@@ -111,7 +118,7 @@ def build(
111
118
target_directory .mkdir ()
112
119
113
120
console .print ("Stage 1 - Download and build dependencies" , style = "bold blue" )
114
- wheel (extension_dir , extra_platforms , extra_index_url , find_links )
121
+ wheel (extension_dir , extra_platforms , extra_index_url , find_links , only_extra_platforms )
115
122
116
123
console .print ("Stage 2 - Create the extension zip file" , style = "bold blue" )
117
124
built_zip = assemble (extension_dir , target_directory )
@@ -179,6 +186,12 @@ def wheel(
179
186
find_links : Optional [str ] = typer .Option (
180
187
None , "--find-links" , "-f" , help = "Extra index url to use when downloading dependencies"
181
188
),
189
+ only_extra_platforms : Optional [bool ] = typer .Option (
190
+ False ,
191
+ "--only-extra-platforms" ,
192
+ "-o" ,
193
+ help = "Only build for the extra platforms, useful when building from arm64 (mac)" ,
194
+ ),
182
195
):
183
196
"""
184
197
Builds the extension and it's dependencies into wheel files
@@ -188,6 +201,7 @@ def wheel(
188
201
:param extra_platforms: Attempt to also download wheels for an extra platform (e.g. manylinux1_x86_64 or win_amd64)
189
202
:param extra_index_url: Extra index url to use when downloading dependencies
190
203
:param find_links: Extra index url to use when downloading dependencies
204
+ :param only_extra_platforms: If true, only build for the extra platforms, useful when building from arm64
191
205
"""
192
206
relative_lib_folder_dir = "extension/lib"
193
207
lib_folder : Path = extension_dir / relative_lib_folder_dir
@@ -201,6 +215,8 @@ def wheel(
201
215
command .extend (["--extra-index-url" , extra_index_url ])
202
216
if find_links is not None :
203
217
command .extend (["--find-links" , find_links ])
218
+ if only_extra_platforms :
219
+ command .append ("--no-deps" )
204
220
command .append ("." )
205
221
run_process (command , cwd = extension_dir )
206
222
0 commit comments