-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
57 lines (44 loc) · 1.26 KB
/
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
46
47
48
49
50
51
52
53
54
55
56
57
import os
import shutil
from mypy import api
from argparse import ArgumentParser
import PyInstaller.__main__
import pytest
def check_types() -> None:
print("> mypy")
results = api.run([])
if results[0]:
print("Type checking results:")
print(results[0])
if results[1]:
print("Error report:")
print(results[1])
def check_all() -> None:
check_types()
print()
run_tests()
print()
def run_tests() -> None:
print("runing tests")
pytest.main(["testing/"])
if __name__ == "__main__":
parser = ArgumentParser(
prog="Rouge", description="A Rogue-like written in pygame-ce"
)
parser.add_argument("--build", action="store_true")
parser.add_argument("--test", action="store_true")
parser.add_argument("--check-all", action="store_true")
parser.add_argument("--check-types", action="store_true")
args = parser.parse_args()
if args.check_all:
check_all()
else:
if args.check_types:
check_types()
if args.test:
run_tests()
if args.build:
PyInstaller.__main__.run(["pitd.spec"])
resources_src = "resources"
resources_dest = os.path.join("pitd", "resources")
shutil.copytree(resources_src, resources_dest)