Skip to content
  • David Runge's avatar
    Add conversion from Package to OutputPackageBase and OutputPackage · c92733ce
    David Runge authored
    repod/files/__init__.py:
    Do not import top-level from repod.repo.management and repod.convert to
    circumvent circular import.
    
    repod/files/package.py:
    Change `PackageV1` to also derive from the common models `CSize`,
    `FileName`, `Md5Sum`, `PgpSig` and `Sha256Sum`, as these fields are
    required in the context of the management repository.
    Change `Package.from_file()` to accept a signature file as second
    argument and to also populate the `csize`, `filename`, `md5sum`,
    `pgpsig` and `sha256sum` fields.
    
    repod/repo/management/outputpackage.py:
    Add `OUTPUT_PACKAGE_VERSIONS` to track required and optional fields for
    the derivates of OutputPackage.
    Add the `OutputPackage.from_package()` classmethod to create a derivate
    of OutputPackage from a `Package`.
    Add the `OutputPackageBase.from_package()` classmethod to create a
    derivate of OutputPackage from a list of `Package` instances.
    
    tests/conftest.py:
    Add session scoped `BuildinfoV1`, `BuildInfoV2`, `PkgInfoV1`,
    `PkgInfoV2` and `PackageV1` fixtures.
    Change `default_package_file` fixture to also return a dummy signature
    file alongside the package file.
    
    tests/files/test_common.py:
    Adapt tests to changed `default_package_file` fixture.
    
    tests/files/test_package.py:
    Adapt tests to changes in `PackageV1` and `Package.from_file()`
    behavior.
    
    tests/repo/management/test_outputpackage.py:
    Add tests for `OutputPackage.from_package()` and
    `OutputPackageBase.from_package()`.
    c92733ce