Browse Source

Close #28

pull/31/head
Daniel Gyulai 3 years ago
parent
commit
24cdacfcb0
  1. 8
      alice-ci/setup.cfg
  2. 13
      alice-ci/src/alice/__init__.py
  3. 5
      alice-ci/src/alice/__main__.py
  4. 4
      alice-ci/src/alice/cli.py
  5. 2
      alice-ci/src/alice/config.py
  6. 4
      alice-ci/src/alice/configparser.py
  7. 8
      alice-ci/src/alice/runnerfactory.py
  8. 5
      alice-ci/src/alice/runners/__init__.py
  9. 4
      alice-ci/src/alice/runners/dockerrunner.py
  10. 1
      alice-ci/src/alice/runners/pypirunner.py
  11. 4
      alice-ci/src/alice/runners/pythonrunner.py
  12. 4
      alice-ci/src/alice/runners/pyutils.py

8
alice-ci/setup.cfg

@ -16,7 +16,9 @@ classifiers =
[options] [options]
package_dir = package_dir =
= src = src
packages = alice packages =
alice
alice.runners
python_requires = >=3.6 python_requires = >=3.6
install_requires = install_requires =
PyYAML PyYAML
@ -26,5 +28,5 @@ install_requires =
console_scripts = console_scripts =
alice = alice.cli:main alice = alice.cli:main
[options.packages.find] #[options.packages.find]
where = src #where = src

13
alice-ci/src/alice/__init__.py

@ -1,10 +1,9 @@
# flake8: noqa F401 # flake8: noqa F401
from alice.configparser import ConfigParser from .configparser import ConfigParser
from alice.exceptions import NonZeroRetcode from .exceptions import NonZeroRetcode
from alice.runnerfactory import Factory from .runnerfactory import Factory
from alice.runners.pythonrunner import PythonRunner from .exceptions import NonZeroRetcode
from alice.exceptions import NonZeroRetcode from .exceptions import RunnerError
from alice.exceptions import RunnerError from .exceptions import ConfigException
from alice.exceptions import ConfigException
name = "alice" name = "alice"

5
alice-ci/src/alice/__main__.py

@ -1,3 +1,4 @@
from alice.cli import main import alice
main() if __name__ == '__main__':
alice.cli.main()

4
alice-ci/src/alice/cli.py

@ -2,8 +2,8 @@ import logging
import os import os
import argparse import argparse
from alice.configparser import ConfigParser from .configparser import ConfigParser
from alice.exceptions import ConfigException, NonZeroRetcode, RunnerError from .exceptions import ConfigException, NonZeroRetcode, RunnerError
def gen_env(param_list): def gen_env(param_list):

2
alice-ci/src/alice/config.py

@ -1,7 +1,7 @@
import logging import logging
import os import os
from alice.exceptions import ConfigException from .exceptions import ConfigException
class ConfigHolder: class ConfigHolder:

4
alice-ci/src/alice/configparser.py

@ -3,8 +3,8 @@ from os import getcwd, path, environ
import subprocess import subprocess
import yaml import yaml
from alice.exceptions import ConfigException from .exceptions import ConfigException
from alice.runnerfactory import Factory from .runnerfactory import Factory
class ConfigParser: class ConfigParser:

8
alice-ci/src/alice/runnerfactory.py

@ -1,10 +1,10 @@
import logging import logging
from os.path import join, abspath from os.path import join, abspath
from alice.runners.pythonrunner import PythonRunner from .runners.pythonrunner import PythonRunner
from alice.runners.pypirunner import PyPiRunner from .runners.pypirunner import PyPiRunner
from alice.runners.dockerrunner import DockerRunner from .runners.dockerrunner import DockerRunner
from alice.exceptions import ConfigException from .exceptions import ConfigException
class Factory(): class Factory():

5
alice-ci/src/alice/runners/__init__.py

@ -1,3 +1,4 @@
# flake8: noqa F401 # flake8: noqa F401
from alice.runners.pythonrunner import PythonRunner from .pythonrunner import PythonRunner
from alice.runners.pypirunner import PyPiRunner from .pypirunner import PyPiRunner
from .dockerrunner import DockerRunner

4
alice-ci/src/alice/runners/dockerrunner.py

@ -4,8 +4,8 @@ import logging
from os import path, getcwd from os import path, getcwd
import docker import docker
from alice.runners.pyutils import grab_from, gen_dict from .pyutils import grab_from, gen_dict
from alice.exceptions import ConfigException, NonZeroRetcode, RunnerError from ..exceptions import ConfigException, NonZeroRetcode, RunnerError
class ImageSource(Enum): class ImageSource(Enum):

1
alice-ci/src/alice/runners/pypirunner.py

@ -87,7 +87,6 @@ class PyPiRunner():
return sorted(releases, key=parse_version, reverse=True) return sorted(releases, key=parse_version, reverse=True)
def build(self, config, package): def build(self, config, package):
# TODO: Actual build - silent, unless failure!
pkg_path = path.join(config.workdir, package) pkg_path = path.join(config.workdir, package)
if not path.isdir(pkg_path): if not path.isdir(pkg_path):
raise ConfigException(f"Path does not exists: {pkg_path}") raise ConfigException(f"Path does not exists: {pkg_path}")

4
alice-ci/src/alice/runners/pythonrunner.py

@ -4,8 +4,8 @@ import os
import sys import sys
import shlex import shlex
from alice.exceptions import NonZeroRetcode, RunnerError, ConfigException from ..exceptions import NonZeroRetcode, RunnerError, ConfigException
from alice.runners.pyutils import glob_command from .pyutils import glob_command
# TODO: Handle config like PyPiConfig # TODO: Handle config like PyPiConfig

4
alice-ci/src/alice/runners/pyutils.py

@ -5,8 +5,8 @@ import sys
from pkg_resources import parse_version from pkg_resources import parse_version
import re import re
from alice.exceptions import RunnerError, ConfigException from ..exceptions import RunnerError, ConfigException
from alice.config import ConfigHolder from ..config import ConfigHolder
class PackageManager: class PackageManager:

Loading…
Cancel
Save