コード例 #1
0
ファイル: pchaps.py プロジェクト: laebshade/chapps
def binary_goal(args):
    """Create a binary using pants."""

    targets = lib.targets(lib.rel_cwd(), args)

    pants_args = "binary {0}".format(targets)
    lib.pants(pants_args)
コード例 #2
0
ファイル: pchaps.py プロジェクト: laebshade/chapps
def run_goal(goal, args):
    """Run a target using pants."""

    targets = lib.targets(lib.rel_cwd(), [goal])
    run_args = " ".join(args)

    pants_args = "run {0} {1}".format(targets, run_args)
    lib.pants(pants_args)
コード例 #3
0
ファイル: pchaps.py プロジェクト: laebshade/chapps
def test_goal(args, options):
    """Use test.pytest goal with pants."""

    if options.all:
        targets = "%s::" % lib.rel_cwd().replace('src', 'tests')
    else:
        targets = lib.targets(lib.rel_cwd(), args)

    pants_args = "test.pytest  {0} {1} {2}".format(
        "--coverage=%d" % int(options.coverage),
        "--test-pytest-options='%s'" % lib.pytest_options(options),
        targets,
    )
    lib.pants(pants_args)
コード例 #4
0
ファイル: pchaps.py プロジェクト: laebshade/chapps
def clean_goal():
    """Clean pants."""
    lib.pants("clean-all")
コード例 #5
0
ファイル: pchaps.py プロジェクト: laebshade/chapps
def repl_goal(args):
    """Enter an ipython REPL."""
    targets = lib.targets(lib.rel_cwd(), args)
    pants_args = "repl --repl-py-ipython {0}".format(targets)
    lib.pants(pants_args)
コード例 #6
0
ファイル: pchaps.py プロジェクト: laebshade/chapps
def fmt_goal(args):
    """Fix common format issues using pants fmt goal."""
    targets = lib.targets(lib.rel_cwd(), args)
    pants_args = "fmt {0}".format(targets)
    lib.pants(pants_args)