MCPcopy Create free account
hub / github.com/kyegomez/BitNet / run

Method run

setup.py:205–229  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

203 """
204
205 def run(self):
206 if FORCE_BUILD:
207 return super().run()
208
209 wheel_url, wheel_filename = get_wheel_url()
210 print("Guessing wheel URL: ", wheel_url)
211 try:
212 urllib.request.urlretrieve(wheel_url, wheel_filename)
213
214 # Make the archive
215 # Lifted from the root wheel processing command
216 # https://github.com/pypa/wheel/blob/cf71108ff9f6ffc36978069acb28824b44ae028e/src/wheel/bdist_wheel.py#LL381C9-L381C85
217 if not os.path.exists(self.dist_dir):
218 os.makedirs(self.dist_dir)
219
220 impl_tag, abi_tag, plat_tag = self.get_tag()
221 archive_basename = f"{self.wheel_dist_name}-{impl_tag}-{abi_tag}-{plat_tag}"
222
223 wheel_path = os.path.join(self.dist_dir, archive_basename + ".whl")
224 print("Raw wheel path", wheel_path)
225 shutil.move(wheel_filename, wheel_path)
226 except urllib.error.HTTPError:
227 print("Precompiled wheel not found. Building from source...")
228 # If the wheel could not be downloaded, build from source
229 super().run()
230
231
232setup(

Callers

nothing calls this directly

Calls 1

get_wheel_urlFunction · 0.85

Tested by

no test coverage detected