Beispiel #1
0
ARGUMENTS = [
    Argument.CONDA_ENV_FILE, Argument.TEST_WORKING_DIRECTORY,
    Argument.TEST_LABELS, Argument.WORKING_DIRECTORY
]


@unique
class Key(Enum):
    '''Enum for Test File Keys'''
    tests = auto()
    name = auto()
    command = auto()


_TEST_SCHEMA = {
    Key.name.name: utils.make_schema_type(str, True),
    Key.command.name: utils.make_schema_type(str, True)
}

_TEST_FILE_SCHEMA = {Key.tests.name: utils.make_schema_type([_TEST_SCHEMA])}


class TestCommand():
    """
    Contains a test to run within a given conda environment.

    Args:
        name (str): The name describing the test.
        conda_env (str): The name of the conda environment that the test will be run in.
        bash_command (str): The bash command to run.
        create_env (bool): Whether this is the command to create a new conda environment.
@unique
class Key(Enum):
    '''Enum for Open-CE Info Keys'''
    third_party_packages = auto()
    name = auto()
    version = auto()
    license = auto()
    url = auto()
    license_url = auto()
    license_files = auto()
    copyright_string = auto()


_THIRD_PARTY_PACKAGE_SCHEMA = {
    Key.name.name: utils.make_schema_type(str, True),
    Key.version.name: utils.make_schema_type(str, True),
    Key.license.name: utils.make_schema_type(str, True),
    Key.url.name: utils.make_schema_type([str], True),
    Key.license_url.name: utils.make_schema_type(str),
    Key.license_files.name: utils.make_schema_type([str]),
    Key.copyright_string.name: utils.make_schema_type(str),
}

_OPEN_CE_INFO_SCHEMA = {
    Key.third_party_packages.name:
    utils.make_schema_type([_THIRD_PARTY_PACKAGE_SCHEMA]),
}


class LicenseGenerator():
Beispiel #3
0
    imported_envs = auto()
    channels = auto()
    packages = auto()
    git_tag_for_env = auto()
    git_tag = auto()
    feedstock = auto()
    recipes = auto()
    external_dependencies = auto()
    patches = auto()
    opence_env_file_path = auto()
    runtime_package = auto()
    recipe_path = auto()


_PACKAGE_SCHEMA = {
    Key.feedstock.name: utils.make_schema_type(str, True),
    Key.git_tag.name: utils.make_schema_type(str),
    Key.recipes.name: utils.make_schema_type([str]),
    Key.channels.name: utils.make_schema_type([str]),
    Key.patches.name: utils.make_schema_type([str]),
    Key.runtime_package.name: utils.make_schema_type(bool),
    Key.recipe_path.name: utils.make_schema_type(str)
}

_ENV_CONFIG_SCHEMA = {
    Key.imported_envs.name: utils.make_schema_type([str]),
    Key.channels.name: utils.make_schema_type([str]),
    Key.git_tag_for_env.name: utils.make_schema_type(str),
    Key.external_dependencies.name: utils.make_schema_type([str]),
    Key.packages.name: utils.make_schema_type([_PACKAGE_SCHEMA])
}