Source code for checkon.tox
import typing as t
import attr
import marshmallow_dataclass
import pyrsistent
from . import schemas
[docs]@attr.s(auto_attribs=True)
class VersionInfo:
major: int
minor: int
micro: int
releaselevel: str
serial: int
[docs] @classmethod
def from_tuple(cls, tup):
return cls(tup)
[docs]@attr.s(auto_attribs=True)
class Python:
is_64: bool
version_info: t.Tuple[int, int, int, str, int]
executable: str
name: str
sysplatform: str
version: str
[docs]@attr.s(auto_attribs=True)
class Setup:
retcode: int
output: str
command: t.List[str] = attr.ib(converter=pyrsistent.freeze)
[docs]@attr.s(auto_attribs=True)
class Test:
retcode: int
output: str
command: t.List[str] = attr.ib(converter=pyrsistent.freeze)
[docs]@attr.s(auto_attribs=True)
class InstallPkg:
sha256: str
basename: str
[docs]@attr.s(auto_attribs=True)
class TestEnv:
python: Python
setup: t.List[Setup]
name: t.Optional[str]
test: t.Optional[t.List[Test]] = None
installpkg: t.Optional[InstallPkg] = attr.ib(default=None)
installed_packages: t.List[str] = attr.ib(converter=pyrsistent.freeze, factory=list)
[docs] @classmethod
def from_dict(cls, data, name):
cls(**data, name=name)
[docs]@attr.s(auto_attribs=True, frozen=True)
class ToxRun:
toxversion: str
commands: t.List[t.Any] = attr.ib(converter=pyrsistent.freeze)
platform: str
host: str
testenvs: t.Dict[str, TestEnv] = attr.ib(
converter=lambda d: {k: attr.evolve(v, name=k) for k, v in d.items()}
)
reportversion: str
[docs] @classmethod
def from_path(cls, path):
schema = schemas.class_schema(cls)()
with open(path) as f:
return schema.loads(f.read())