-
Notifications
You must be signed in to change notification settings - Fork 11
/
setup.py
45 lines (36 loc) · 903 Bytes
/
setup.py
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
from __future__ import annotations
import os
import subprocess
import sys
from pathlib import Path
from setuptools import setup
from setuptools.command.build_py import build_py
def generate_property_templates():
subprocess.run(
[
sys.executable,
os.fspath(Path(__file__).parent.joinpath("tools", "create_class_definitions.py")),
"dread",
],
check=True,
)
subprocess.run(
[
sys.executable,
os.fspath(Path(__file__).parent.joinpath("tools", "create_class_definitions.py")),
"sr",
],
check=True,
)
class BuildPyCommand(build_py):
"""
Generate script templates code before building the package.
"""
def run(self):
generate_property_templates()
build_py.run(self)
setup(
cmdclass={
"build_py": BuildPyCommand,
},
)