Add stubs for clean/test/install.

This commit is contained in:
Jelmer Vernooij 2021-02-05 15:56:24 +00:00
parent e098fa66f5
commit a0a494b4f8
No known key found for this signature in database
GPG key ID: 579C160D4C9E23E8
2 changed files with 31 additions and 2 deletions

View file

@ -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'):

View file

@ -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