-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
42 lines (31 loc) · 891 Bytes
/
setup.py
File metadata and controls
42 lines (31 loc) · 891 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
39
40
41
42
"""Post-install hook to eagerly download marp-cli standalone binary.
Works for source installs (pip install -e . / pip install .).
For wheel installs the lazy download on first compile handles it.
"""
import subprocess
import sys
from setuptools import setup
from setuptools.command.develop import develop
from setuptools.command.install import install
def _post_install():
try:
subprocess.check_call(
[sys.executable, "-c", "from cdl_slides.marp_cli import resolve_marp_cli; resolve_marp_cli()"],
timeout=120,
)
except Exception:
pass
class PostInstall(install):
def run(self):
install.run(self)
_post_install()
class PostDevelop(develop):
def run(self):
develop.run(self)
_post_install()
setup(
cmdclass={
"install": PostInstall,
"develop": PostDevelop,
}
)