-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
38 lines (29 loc) · 977 Bytes
/
Copy pathsetup.py
File metadata and controls
38 lines (29 loc) · 977 Bytes
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
"""setup.py — post-install hook to download SDPCLI binary.
All package metadata is in pyproject.toml. This file only adds the
post-install hook that downloads SDPCLI from GitHub Releases.
"""
from setuptools import setup
from setuptools.command.install import install
from setuptools.command.develop import develop
class _PostInstallMixin:
def _post_install(self):
try:
from scripts.fetch_sdpcli import main
main()
except Exception as e:
print(f"[pysdp] SDPCLI auto-download skipped: {e}")
print("[pysdp] Run 'pysdp-fetch' manually to download SDPCLI binary.")
class PostInstall(_PostInstallMixin, install):
def run(self):
install.run(self)
self._post_install()
class PostDevelop(_PostInstallMixin, develop):
def run(self):
develop.run(self)
self._post_install()
setup(
cmdclass={
"install": PostInstall,
"develop": PostDevelop,
},
)