From 4a6bfa0d52ac0699954b9505d782b7fc6a253c3e Mon Sep 17 00:00:00 2001 From: gyulaid Date: Sun, 27 Mar 2022 13:47:07 +0200 Subject: [PATCH] package rename --- {alice => alice-ci}/README.md | 0 {alice => alice-ci}/pyproject.toml | 0 {alice => alice-ci}/setup.cfg | 4 +++- alice-ci/src/alice/__init__.py | 4 ++++ {alice => alice-ci}/src/alice/__main__.py | 0 {alice => alice-ci}/src/alice/cli.py | 7 ++++++- {alice => alice-ci}/src/alice/docker.py | 0 {alice => alice-ci}/src/alice/exceptions.py | 0 {alice => alice-ci}/src/alice/jobparser.py | 0 {alice => alice-ci}/src/alice/pythonrunner.py | 0 alice/src/alice/__init__.py | 0 11 files changed, 13 insertions(+), 2 deletions(-) rename {alice => alice-ci}/README.md (100%) rename {alice => alice-ci}/pyproject.toml (100%) rename {alice => alice-ci}/setup.cfg (89%) create mode 100644 alice-ci/src/alice/__init__.py rename {alice => alice-ci}/src/alice/__main__.py (100%) rename {alice => alice-ci}/src/alice/cli.py (91%) rename {alice => alice-ci}/src/alice/docker.py (100%) rename {alice => alice-ci}/src/alice/exceptions.py (100%) rename {alice => alice-ci}/src/alice/jobparser.py (100%) rename {alice => alice-ci}/src/alice/pythonrunner.py (100%) delete mode 100644 alice/src/alice/__init__.py diff --git a/alice/README.md b/alice-ci/README.md similarity index 100% rename from alice/README.md rename to alice-ci/README.md diff --git a/alice/pyproject.toml b/alice-ci/pyproject.toml similarity index 100% rename from alice/pyproject.toml rename to alice-ci/pyproject.toml diff --git a/alice/setup.cfg b/alice-ci/setup.cfg similarity index 89% rename from alice/setup.cfg rename to alice-ci/setup.cfg index a5ae477..a81e9c2 100644 --- a/alice/setup.cfg +++ b/alice-ci/setup.cfg @@ -1,5 +1,5 @@ [metadata] -name = alice +name = alice-ci version = 0.0.1 author = Daniel Gyulai description = Alice CI framework @@ -18,6 +18,8 @@ package_dir = = src packages = find: python_requires = >=3.6 +install_requires = + PyYAML==6.0 [options.packages.find] where = src \ No newline at end of file diff --git a/alice-ci/src/alice/__init__.py b/alice-ci/src/alice/__init__.py new file mode 100644 index 0000000..e675421 --- /dev/null +++ b/alice-ci/src/alice/__init__.py @@ -0,0 +1,4 @@ +from .cli import App +from .jobparser import Job, JobParser +from .exceptions import NonZeroRetcode +from .pythonrunner import PythonRunner \ No newline at end of file diff --git a/alice/src/alice/__main__.py b/alice-ci/src/alice/__main__.py similarity index 100% rename from alice/src/alice/__main__.py rename to alice-ci/src/alice/__main__.py diff --git a/alice/src/alice/cli.py b/alice-ci/src/alice/cli.py similarity index 91% rename from alice/src/alice/cli.py rename to alice-ci/src/alice/cli.py index ff35b0d..ad1d40f 100644 --- a/alice/src/alice/cli.py +++ b/alice-ci/src/alice/cli.py @@ -54,6 +54,7 @@ class App: self.restart_under_venv() else: print("Running under virtual environment") + # TODO: yaml is only used in venv, yet installed as dependency in setup.cfg self.pip_install("pyyaml", "yaml") from jobparser import JobParser @@ -67,7 +68,8 @@ class App: jobParser.jobs[step].run_commands(self.__gen_env(args.env)) print(f"Step {step}: SUCCESS") else: - raise Exception(f"Step {step} not found in {args.input}") + print(f"Step {step} not found in {args.input}") + exit(1) def main(): pathToScriptDir = os.path.dirname(os.path.realpath(__file__)) @@ -79,6 +81,9 @@ def main(): parser.add_argument("-i", "--input", default="ci.yaml") parser.add_argument("-e", "--env", nargs='*', default=[]) args = parser.parse_args() + if not os.path.isfile(args.input): + print(f"No such file: {args.input}") + exit(1) app.run(args, repoDir) if __name__ == "__main__": diff --git a/alice/src/alice/docker.py b/alice-ci/src/alice/docker.py similarity index 100% rename from alice/src/alice/docker.py rename to alice-ci/src/alice/docker.py diff --git a/alice/src/alice/exceptions.py b/alice-ci/src/alice/exceptions.py similarity index 100% rename from alice/src/alice/exceptions.py rename to alice-ci/src/alice/exceptions.py diff --git a/alice/src/alice/jobparser.py b/alice-ci/src/alice/jobparser.py similarity index 100% rename from alice/src/alice/jobparser.py rename to alice-ci/src/alice/jobparser.py diff --git a/alice/src/alice/pythonrunner.py b/alice-ci/src/alice/pythonrunner.py similarity index 100% rename from alice/src/alice/pythonrunner.py rename to alice-ci/src/alice/pythonrunner.py diff --git a/alice/src/alice/__init__.py b/alice/src/alice/__init__.py deleted file mode 100644 index e69de29..0000000