@@ -109,7 +109,7 @@ def run(self) -> None:
109
109
},
110
110
{
111
111
"wheel" : "win32.whl" ,
112
- "machine" : "amd64 " ,
112
+ "machine" : "i386 " ,
113
113
"platform" : "win32" ,
114
114
"zip_name" : "win32_x64" ,
115
115
},
@@ -120,20 +120,27 @@ def run(self) -> None:
120
120
"zip_name" : "win32_x64" ,
121
121
},
122
122
]
123
- self ._install_local_driver (base_wheel_bundles )
124
- if self .all :
125
- self ._install_all_wheels (base_wheel_bundles )
123
+ self ._download_and_extract_local_driver (base_wheel_bundles )
124
+
125
+ wheels = base_wheel_bundles
126
+ if not self .all :
127
+ wheels = list (
128
+ filter (
129
+ lambda wheel : wheel ["platform" ] == sys .platform
130
+ and wheel ["machine" ] == platform .machine ().lower (),
131
+ base_wheel_bundles ,
132
+ )
133
+ )
134
+ self ._build_wheels (wheels )
126
135
127
- def _install_all_wheels (
136
+ def _build_wheels (
128
137
self ,
129
138
wheels : List [Dict [str , str ]],
130
139
) -> None :
131
- for wheel_bundle in wheels :
132
- download_driver (wheel_bundle ["zip_name" ])
133
140
base_wheel_location : str = glob .glob (os .path .join (self .dist_dir , "*.whl" ))[0 ]
134
141
without_platform = base_wheel_location [:- 7 ]
135
-
136
142
for wheel_bundle in wheels :
143
+ download_driver (wheel_bundle ["zip_name" ])
137
144
zip_file = (
138
145
f"driver/playwright-{ driver_version } -{ wheel_bundle ['zip_name' ]} .zip"
139
146
)
@@ -152,7 +159,6 @@ def _install_all_wheels(
152
159
"playwright/driver/README.md" ,
153
160
f"{ wheel_bundle ['wheel' ]} driver package" ,
154
161
)
155
-
156
162
os .remove (base_wheel_location )
157
163
if InWheel :
158
164
for whlfile in glob .glob (os .path .join (self .dist_dir , "*.whl" )):
@@ -168,15 +174,15 @@ def _install_all_wheels(
168
174
else :
169
175
print ("auditwheel not installed, not updating RECORD file" )
170
176
171
- def _install_local_driver (
177
+ def _download_and_extract_local_driver (
172
178
self ,
173
179
wheels : List [Dict [str , str ]],
174
180
) -> None :
175
181
zip_names_for_current_system = set (
176
182
map (
177
183
lambda wheel : wheel ["zip_name" ],
178
184
filter (
179
- lambda wheel : wheel ["machine" ] == platform .machine ()
185
+ lambda wheel : wheel ["machine" ] == platform .machine (). lower ()
180
186
and wheel ["platform" ] == sys .platform ,
181
187
wheels ,
182
188
),
0 commit comments