MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / initialize

Method initialize

hatch_build.py:15–36  ·  view source on GitHub ↗

Initialize the hook.

(self, version, build_data)

Source from the content-addressed store, hash-verified

13 """The pymongo build hook."""
14
15 def initialize(self, version, build_data):
16 """Initialize the hook."""
17 if self.target_name == "sdist":
18 return
19 here = Path(__file__).parent.resolve()
20 sys.path.insert(0, str(here))
21
22 subprocess.run([sys.executable, "_setup.py", "build_ext", "-i"], check=True)
23
24 # Ensure wheel is marked as binary and contains the binary files.
25 build_data["infer_tag"] = True
26 build_data["pure_python"] = False
27 if os.name == "nt":
28 patt = ".pyd"
29 else:
30 patt = ".so"
31 for pkg in ["bson", "pymongo"]:
32 dpath = here / pkg
33 for fpath in dpath.glob(f"*{patt}"):
34 relpath = os.path.relpath(fpath, here)
35 build_data["artifacts"].append(relpath)
36 build_data["force_include"][relpath] = relpath

Callers

nothing calls this directly

Calls 1

runMethod · 0.45

Tested by

no test coverage detected