-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
47 lines (38 loc) · 1.2 KB
/
Copy pathsetup.py
File metadata and controls
47 lines (38 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
"""Selective wheel build for the standalone OnStep adapter."""
from __future__ import annotations
import shutil
from setuptools import setup
from setuptools.command.build_py import build_py
class SelectiveBuildPy(build_py):
_allowed_modules = {
"onstep_adapter": {
"__init__",
"client",
"focuser",
"firmware_proof",
"mount",
"location",
"results",
"safety",
"serial_bus",
"state_store",
},
"onstep_adapter.tools": {
"__init__",
"axis_motion_smoke",
"coordinate_axis_smoke",
},
"onstep_adapter.ports": {"__init__", "focuser", "mount"},
}
def run(self) -> None:
shutil.rmtree(self.build_lib, ignore_errors=True)
super().run()
def find_package_modules(
self,
package: str,
package_dir: str,
) -> list[tuple[str, str, str]]:
modules = super().find_package_modules(package, package_dir)
allowed = self._allowed_modules.get(package, set())
return [module for module in modules if module[1] in allowed]
setup(cmdclass={"build_py": SelectiveBuildPy})