forked from randovania/retro-data-structures
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
32 lines (24 loc) · 689 Bytes
/
Copy pathsetup.py
File metadata and controls
32 lines (24 loc) · 689 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
import os
import subprocess
import sys
from pathlib import Path
from setuptools import setup
from setuptools.command.egg_info import egg_info
def generate_property_templates():
subprocess.run([
sys.executable,
os.fspath(Path(__file__).parent.joinpath("parse_pwe_templates.py"))
], check=True)
class GenerateTemplateCommand(egg_info):
"""
Generate script templates code before building the package.
"""
def run(self):
if Path(__file__).parent.joinpath("PrimeWorldEditor").is_dir():
generate_property_templates()
return egg_info.run(self)
setup(
cmdclass={
'egg_info': GenerateTemplateCommand,
},
)