Add stubs for clean/test/install.
This commit is contained in:
parent
e098fa66f5
commit
a0a494b4f8
2 changed files with 31 additions and 2 deletions
|
@ -87,6 +87,22 @@ def run_with_build_fixer(session, args):
|
|||
session.check_call(args)
|
||||
|
||||
|
||||
def run_build(session):
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
def run_clean(session):
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
def run_test(session):
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
def run_install(session):
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
def run_dist(session):
|
||||
# TODO(jelmer): Check $PATH rather than hardcoding?
|
||||
if not os.path.exists('/usr/bin/git'):
|
||||
|
|
|
@ -17,13 +17,18 @@
|
|||
|
||||
import os
|
||||
import sys
|
||||
from . import run_dist, NoBuildToolsFound, note
|
||||
from . import (
|
||||
run_dist, run_build, run_clean, run_install, run_test, NoBuildToolsFound,
|
||||
note
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
import argparse
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('subcommand', type=str, choices=['dist'])
|
||||
parser.add_argument(
|
||||
'subcommand', type=str,
|
||||
choices=['dist', 'build', 'clean', 'test', 'install'])
|
||||
parser.add_argument(
|
||||
'--directory', '-d', type=str, help='Directory for project.',
|
||||
default='.')
|
||||
|
@ -41,6 +46,14 @@ def main():
|
|||
try:
|
||||
if args.subcommand == 'dist':
|
||||
run_dist(session)
|
||||
if args.subcommand == 'build':
|
||||
run_build(session)
|
||||
if args.subcommand == 'clean':
|
||||
run_clean(session)
|
||||
if args.subcommand == 'install':
|
||||
run_install(session)
|
||||
if args.subcommand == 'test':
|
||||
run_test(session)
|
||||
except NoBuildToolsFound:
|
||||
note('No build tools found.')
|
||||
return 1
|
||||
|
|
Loading…
Add table
Reference in a new issue