Loading setup.cfg +2 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,8 @@ testing = # And any other entry points, for example: # pyscaffold.cli = # awesome = pyscaffoldext.awesome.extension:AwesomeExtension console_scripts = pmake = pmake.make:run [tool:pytest] # Specify command line options as you would do when invoking pytest directly. Loading src/pmake/args.py +2 −0 Original line number Diff line number Diff line import logging, sys from functools import wraps import typer Loading @@ -17,6 +18,7 @@ def setup_logging(loglevel): ) def cmdline(main): @wraps(main) def run(): setup_logging(logging.INFO) _logger.debug("Running program...") Loading src/pmake/make.py +6 −5 Original line number Diff line number Diff line Loading @@ -21,17 +21,16 @@ from .manager import Manager _logger = logging.getLogger(__name__) @cmdline def run(rules: Path = typer.Argument("rules.yaml", help="Make rules."), targets: Path = typer.Argument("targets.yaml", help="Make targets."), def run1(rules: Path = typer.Argument(Path("rules.yaml"), help="Make rules."), targets: Path = typer.Argument(Path("targets.yaml"), help="Make targets."), minutes: float = typer.Argument(math.inf, help="Number of minutes available to run steps."), workdir : Optional[Path] = typer.Option(None, help="Store all jobscripts and job logs in this directory (instead of each target's dir).") workdir : Path = typer.Option(Path(), help="Store all jobscripts and job logs in this directory (instead of each target's dir)."), log : Optional[Path] = typer.Option(None, help="Output a debug-level logfile."), test : bool = typer.Option(False, help="List jobs, but do not create jobfiles or run anything.") ): if log is not None: logging.basicConfig(filename=str(log), level=logging.DEBUG) if work is not None: if workdir is not None: workdir.mkdir(exist_ok=True, parents=True) assert workdir.is_dir(), f"Unable to make directory {workdir}" Loading Loading @@ -65,6 +64,8 @@ def run(rules: Path = typer.Argument("rules.yaml", help="Make rules."), R.run( G.get_work, test ) run = cmdline(run1) if __name__=="__main__": import sys main(sys.argv) Loading tests/test_fmatch.py +1 −1 Original line number Diff line number Diff line import unittest from fmatch import * from pmake.fmatch import * class TestFMatch(unittest.TestCase): def test_var(self): Loading tests/test_machine.py +1 −1 Original line number Diff line number Diff line import unittest from machine import * from pmake.machine import * class TestMachine(unittest.TestCase): def test_alloc(self): Loading Loading
setup.cfg +2 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,8 @@ testing = # And any other entry points, for example: # pyscaffold.cli = # awesome = pyscaffoldext.awesome.extension:AwesomeExtension console_scripts = pmake = pmake.make:run [tool:pytest] # Specify command line options as you would do when invoking pytest directly. Loading
src/pmake/args.py +2 −0 Original line number Diff line number Diff line import logging, sys from functools import wraps import typer Loading @@ -17,6 +18,7 @@ def setup_logging(loglevel): ) def cmdline(main): @wraps(main) def run(): setup_logging(logging.INFO) _logger.debug("Running program...") Loading
src/pmake/make.py +6 −5 Original line number Diff line number Diff line Loading @@ -21,17 +21,16 @@ from .manager import Manager _logger = logging.getLogger(__name__) @cmdline def run(rules: Path = typer.Argument("rules.yaml", help="Make rules."), targets: Path = typer.Argument("targets.yaml", help="Make targets."), def run1(rules: Path = typer.Argument(Path("rules.yaml"), help="Make rules."), targets: Path = typer.Argument(Path("targets.yaml"), help="Make targets."), minutes: float = typer.Argument(math.inf, help="Number of minutes available to run steps."), workdir : Optional[Path] = typer.Option(None, help="Store all jobscripts and job logs in this directory (instead of each target's dir).") workdir : Path = typer.Option(Path(), help="Store all jobscripts and job logs in this directory (instead of each target's dir)."), log : Optional[Path] = typer.Option(None, help="Output a debug-level logfile."), test : bool = typer.Option(False, help="List jobs, but do not create jobfiles or run anything.") ): if log is not None: logging.basicConfig(filename=str(log), level=logging.DEBUG) if work is not None: if workdir is not None: workdir.mkdir(exist_ok=True, parents=True) assert workdir.is_dir(), f"Unable to make directory {workdir}" Loading Loading @@ -65,6 +64,8 @@ def run(rules: Path = typer.Argument("rules.yaml", help="Make rules."), R.run( G.get_work, test ) run = cmdline(run1) if __name__=="__main__": import sys main(sys.argv) Loading
tests/test_fmatch.py +1 −1 Original line number Diff line number Diff line import unittest from fmatch import * from pmake.fmatch import * class TestFMatch(unittest.TestCase): def test_var(self): Loading
tests/test_machine.py +1 −1 Original line number Diff line number Diff line import unittest from machine import * from pmake.machine import * class TestMachine(unittest.TestCase): def test_alloc(self): Loading