forked from pandas-dev/pandas
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcmds.py
36 lines (28 loc) · 944 Bytes
/
cmds.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
import click
from devpy.cmds.util import run
@click.command()
@click.option("--clean", is_flag=True, help="Clean build directory")
@click.option(
"--debug",
is_flag=True,
help="Build C extensions with debugging symbols and without optimization",
)
def build(clean, debug):
extra_args = []
if debug:
# Need to clean first, since there is a bug in
# Cython, where it can't tell extensions need to be recompiled
# when rebuilding in debug mode
extra_args.append("--with-debugging-symbols")
clean = True
if clean:
print("Running clean.")
run(["python", "setup.py", "clean"])
# TODO: Rely on pip for backend agnostic build
build_cmd = ["python", "setup.py", "develop"]
build_cmd += extra_args
run(build_cmd)
@click.command()
@click.argument("pytest_args", nargs=-1)
def test(pytest_args):
run(["python", "-m", "pytest"] + list(pytest_args))