diff --git a/alice-ci/setup.cfg b/alice-ci/setup.cfg index 2c4cdee..20b563d 100644 --- a/alice-ci/setup.cfg +++ b/alice-ci/setup.cfg @@ -16,7 +16,9 @@ classifiers = [options] package_dir = = src -packages = alice +packages = + alice + alice.runners python_requires = >=3.6 install_requires = PyYAML @@ -26,5 +28,5 @@ install_requires = console_scripts = alice = alice.cli:main -[options.packages.find] -where = src \ No newline at end of file +#[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 index 3c513fe..9a0f501 100644 --- a/alice-ci/src/alice/__init__.py +++ b/alice-ci/src/alice/__init__.py @@ -1,10 +1,9 @@ # flake8: noqa F401 -from alice.configparser import ConfigParser -from alice.exceptions import NonZeroRetcode -from alice.runnerfactory import Factory -from alice.runners.pythonrunner import PythonRunner -from alice.exceptions import NonZeroRetcode -from alice.exceptions import RunnerError -from alice.exceptions import ConfigException +from .configparser import ConfigParser +from .exceptions import NonZeroRetcode +from .runnerfactory import Factory +from .exceptions import NonZeroRetcode +from .exceptions import RunnerError +from .exceptions import ConfigException name = "alice" \ No newline at end of file diff --git a/alice-ci/src/alice/__main__.py b/alice-ci/src/alice/__main__.py index a4d3a54..d5cb563 100644 --- a/alice-ci/src/alice/__main__.py +++ b/alice-ci/src/alice/__main__.py @@ -1,3 +1,4 @@ -from alice.cli import main +import alice -main() +if __name__ == '__main__': + alice.cli.main() diff --git a/alice-ci/src/alice/cli.py b/alice-ci/src/alice/cli.py index 5cfc193..5630055 100644 --- a/alice-ci/src/alice/cli.py +++ b/alice-ci/src/alice/cli.py @@ -2,8 +2,8 @@ import logging import os import argparse -from alice.configparser import ConfigParser -from alice.exceptions import ConfigException, NonZeroRetcode, RunnerError +from .configparser import ConfigParser +from .exceptions import ConfigException, NonZeroRetcode, RunnerError def gen_env(param_list): diff --git a/alice-ci/src/alice/config.py b/alice-ci/src/alice/config.py index 3598fd3..d0d473b 100644 --- a/alice-ci/src/alice/config.py +++ b/alice-ci/src/alice/config.py @@ -1,7 +1,7 @@ import logging import os -from alice.exceptions import ConfigException +from .exceptions import ConfigException class ConfigHolder: diff --git a/alice-ci/src/alice/configparser.py b/alice-ci/src/alice/configparser.py index f28c083..d65b092 100644 --- a/alice-ci/src/alice/configparser.py +++ b/alice-ci/src/alice/configparser.py @@ -3,8 +3,8 @@ from os import getcwd, path, environ import subprocess import yaml -from alice.exceptions import ConfigException -from alice.runnerfactory import Factory +from .exceptions import ConfigException +from .runnerfactory import Factory class ConfigParser: diff --git a/alice-ci/src/alice/runnerfactory.py b/alice-ci/src/alice/runnerfactory.py index 11b7b41..424d213 100644 --- a/alice-ci/src/alice/runnerfactory.py +++ b/alice-ci/src/alice/runnerfactory.py @@ -1,10 +1,10 @@ import logging from os.path import join, abspath -from alice.runners.pythonrunner import PythonRunner -from alice.runners.pypirunner import PyPiRunner -from alice.runners.dockerrunner import DockerRunner -from alice.exceptions import ConfigException +from .runners.pythonrunner import PythonRunner +from .runners.pypirunner import PyPiRunner +from .runners.dockerrunner import DockerRunner +from .exceptions import ConfigException class Factory(): diff --git a/alice-ci/src/alice/runners/__init__.py b/alice-ci/src/alice/runners/__init__.py index b67238e..8c0f819 100644 --- a/alice-ci/src/alice/runners/__init__.py +++ b/alice-ci/src/alice/runners/__init__.py @@ -1,3 +1,4 @@ # flake8: noqa F401 -from alice.runners.pythonrunner import PythonRunner -from alice.runners.pypirunner import PyPiRunner +from .pythonrunner import PythonRunner +from .pypirunner import PyPiRunner +from .dockerrunner import DockerRunner diff --git a/alice-ci/src/alice/runners/dockerrunner.py b/alice-ci/src/alice/runners/dockerrunner.py index 3a84fed..45a500c 100644 --- a/alice-ci/src/alice/runners/dockerrunner.py +++ b/alice-ci/src/alice/runners/dockerrunner.py @@ -4,8 +4,8 @@ import logging from os import path, getcwd import docker -from alice.runners.pyutils import grab_from, gen_dict -from alice.exceptions import ConfigException, NonZeroRetcode, RunnerError +from .pyutils import grab_from, gen_dict +from ..exceptions import ConfigException, NonZeroRetcode, RunnerError class ImageSource(Enum): diff --git a/alice-ci/src/alice/runners/pypirunner.py b/alice-ci/src/alice/runners/pypirunner.py index 10918bd..63d0d04 100644 --- a/alice-ci/src/alice/runners/pypirunner.py +++ b/alice-ci/src/alice/runners/pypirunner.py @@ -87,7 +87,6 @@ class PyPiRunner(): return sorted(releases, key=parse_version, reverse=True) def build(self, config, package): - # TODO: Actual build - silent, unless failure! pkg_path = path.join(config.workdir, package) if not path.isdir(pkg_path): raise ConfigException(f"Path does not exists: {pkg_path}") diff --git a/alice-ci/src/alice/runners/pythonrunner.py b/alice-ci/src/alice/runners/pythonrunner.py index f23bf8d..07f8a8c 100644 --- a/alice-ci/src/alice/runners/pythonrunner.py +++ b/alice-ci/src/alice/runners/pythonrunner.py @@ -4,8 +4,8 @@ import os import sys import shlex -from alice.exceptions import NonZeroRetcode, RunnerError, ConfigException -from alice.runners.pyutils import glob_command +from ..exceptions import NonZeroRetcode, RunnerError, ConfigException +from .pyutils import glob_command # TODO: Handle config like PyPiConfig diff --git a/alice-ci/src/alice/runners/pyutils.py b/alice-ci/src/alice/runners/pyutils.py index 0446cb4..83b155c 100644 --- a/alice-ci/src/alice/runners/pyutils.py +++ b/alice-ci/src/alice/runners/pyutils.py @@ -5,8 +5,8 @@ import sys from pkg_resources import parse_version import re -from alice.exceptions import RunnerError, ConfigException -from alice.config import ConfigHolder +from ..exceptions import RunnerError, ConfigException +from ..config import ConfigHolder class PackageManager: