From 1e874e790c12839695761a654b44fb427149a353 Mon Sep 17 00:00:00 2001 From: "bozo.kopic" Date: Wed, 28 Jul 2021 01:43:55 +0200 Subject: init --- src_doit/__init__.py | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 src_doit/__init__.py (limited to 'src_doit/__init__.py') diff --git a/src_doit/__init__.py b/src_doit/__init__.py new file mode 100644 index 0000000..e2999f2 --- /dev/null +++ b/src_doit/__init__.py @@ -0,0 +1,56 @@ +from pathlib import Path +import subprocess +import sys + +from . import common + +from .js import * # NOQA +from .py import * # NOQA +from . import js +from . import py + + +__all__ = ['task_clean_all', + 'task_build', + 'task_test', + *js.__all__, + *py.__all__] + + +build_dir = Path('build') +pytest_dir = Path('test_pytest') + + +def task_clean_all(): + """Clean all""" + return {'actions': [(common.rm_rf, [build_dir, + js.dst_dir, + py.json_schema_repo_path])]} + + +def task_build(): + """Build""" + + def build(): + subprocess.run([sys.executable, 'setup.py', '-q', 'bdist_wheel'], + cwd=str(build_dir), + check=True) + + return {'actions': [build], + 'task_dep': ['py_build']} + + +def task_test(): + """Test""" + + def run(args): + js.dst_dir.mkdir(parents=True, exist_ok=True) + subprocess.run([sys.executable, '-m', 'pytest', + '-s', '-p', 'no:cacheprovider', + *(args or [])], + cwd=str(pytest_dir), + check=True) + + return {'actions': [run], + 'pos_arg': 'args', + 'task_dep': ['py_json_schema_repo']} -- cgit v1.2.3-70-g09d2