MCPcopy Create free account
hub / github.com/Huelse/SEAL-Python / build_ext_with_typing

Class build_ext_with_typing

setup.py:45–66  ·  view source on GitHub ↗

Copy PEP 561 typing files next to the compiled extension.

Source from the content-addressed store, hash-verified

43
44
45class build_ext_with_typing(build_ext):
46 """Copy PEP 561 typing files next to the compiled extension."""
47 typing_files = ("seal.pyi", "py.typed")
48
49 def run(self):
50 super().run()
51 self._copy_typing_files()
52
53 def _copy_typing_files(self):
54 output_dirs = {Path(self.build_lib)}
55 if self.inplace:
56 output_dirs.add(BASE_DIR)
57
58 for target_dir in output_dirs:
59 target_dir.mkdir(parents=True, exist_ok=True)
60 for filename in self.typing_files:
61 source = BASE_DIR / filename
62 if source.exists():
63 destination = target_dir / filename
64 if source.resolve() == destination.resolve():
65 continue
66 copy2(source, destination)
67
68
69ext_modules = [

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected