1. 24 Jun, 2022 1 commit
    • 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
  2. 21 Jun, 2022 1 commit
    • David Runge's avatar
      Make PGP signatures optional in desc files · 131ea02c
      David Runge authored
      repod/common/models.py:
      Change pgpgsig to Optional[str], as desc files may be created without
      the %PGPSIG% field.
      
      repod/repo/package/syncdb.py:
      Move pgpsig in PACKAGE_DESC_VERSIONS from required to optional.
      
      repod/templates/desc_v1.j2:
      Change template to only create and populate the %PGPSIG% field if pgpsig
      is not None.
      
      tests/repo/package/test_syncdb.py:
      Add test case to test_package_desc_from_dict_derive_file_versions() to
      test the scenario in which no pgpsig is provided.
      
      tests/test_convert.py:
      Change `test_file_data_to_model()` to include a test case in which only
      the required fields are present (and no pgpsig).
      Change `test_repodbfile_render_desc_template()` to also include a case
      in which pgpsig is not used.
      131ea02c
  3. 19 Jun, 2022 2 commits
    • David Runge's avatar
      Split repository models by functionality · 4463e7fb
      David Runge authored
      repod/repo/package/syncdb.py:
      Add `FILES_VERSIONS`, `DEFAULT_FILES_VERSION`,
      `DEFAULT_PACKAGE_DESC_VERSION`, `PACKAGE_DESC_VERSIONS`, `PackageDesc`,
      `PackageDescV1`, `Files` and `FilesV1`.
      Import from `repod.repo.management.outputpackage` instead of importing
      its models top-level to circumenvent circular import.
      
      repod/repo/management/outputpackage.py:
      Remove `FILES_VERSIONS`, `DEFAULT_FILES_VERSION`,
      `DEFAULT_PACKAGE_DESC_VERSION`, `PACKAGE_DESC_VERSIONS`, `PackageDesc`,
      `PackageDescV1`, `Files` and `FilesV1`.
      
      repod/cli.py:
      Import RepoDbTypeEnum top-level.
      
      repod/convert.py:
      Import functions and classes from `repod.repo.package` top-level.
      
      repod/files/__init__.py:
      Import functions and classes from `repod.repo.package` and
      `repod.repo.management` top-level.
      
      repod/operations.py:
      Import functions and classes from `repod.convert`, `repod.repo.package`
      and `repod.repo.management` top-level.
      
      repod/repo/__init__.py:
      Import from `repod.repo.package` and `repod.repo.management` to expose
      them top level in the `repod.repo` package.
      
      repod/repo/management/__init__.py:
      Import from `repod.repo.management.outputpackage` to expose them top
      level in the `repod.repo.management` package.
      
      repod/repo/package/__init__.py:
      Import from `repod.repo.management.syncdb` to expose them top
      level in the `repod.repo.package` package.
      
      tests/common/test_models.py:
      Add tests for `BuildDate`, `CSize`, `FileList`, `Name` and `Packager`
      from the removed tests/test_models.py.
      
      tests/conftest.py:
      Import repo related classes top-level from their respective new
      locations.
      
      tests/test_cli.py:
      Import `RepoDbTypeEnum` top-level from its new location.
      
      tests/test_convert.py:
      Import `repod.repo.package` and `repod.repo.package.syncdb` classes
      top-level.
      
      tests/test_files.py:
      Import `repod.repo.management.outputpackage` and `repod.repo.package`
      classes top-level.
      
      tests/test_models.py:
      Remove obsolete tests. They have been distributed in the tests for the
      split repo functionality and the common models.
      
      tests/test_operations.py:
      Import `OutputPackageBaseV1` top-level from its new location.
      
      tests/repo/management/test_outputpackage.py:
      Add tests for all classes and functions in
      `repod.repo.management.outputpackage`.
      
      tests/repo/package/test_syncdb.py;
      Add tests for all classes and functions in
      `repod.repo.package.syncdb`.
      
      tox.ini:
      Export the JSON schema for repod.repo subpackages for the docs.
      4463e7fb
    • David Runge's avatar
      Move repository related models to repo package · edb2e79e
      David Runge authored
      repod/models/package.py -> repod/repo/management/outputpackage.py:
      Move all repository contents related models to a management repository
      specific location. This still encludes models used by package
      repositories, which are split out in a follow-up commit.
      
      repod/models/repo.py -> repod/repo/package/syncdb.py:
      Move package repository related models and functions to a package
      repository specific location.
      edb2e79e
  4. 18 Jun, 2022 18 commits
  5. 17 Jun, 2022 8 commits
  6. 16 Jun, 2022 2 commits
    • David Runge's avatar
      Improve documentation for CompressionTypeEnum · e35b5179
      David Runge authored
      repod/common/enums.py:
      Improve the documentation for CompressionTypeEnum to reflect that it is
      now a string based enum with values representing possible file suffixes.
      e35b5179
    • David Runge's avatar
      Rename config helper functions · 707fa43c
      David Runge authored
      repod/config/settings.py:
      Remove the leading underscore from all config helper functions. It
      serves no purpose and they are not exposed when importing from
      repod.config.
      707fa43c
  7. 15 Jun, 2022 6 commits
    • David Runge's avatar
      Use default management repo directory · e823fe2b
      David Runge authored
      repod/config/settings.py:
      Use `repod.config.defaults.MANAGEMENT_REPO` as default directory for the
      `ManagementRepo` model.
      e823fe2b
    • David Runge's avatar
      Remove duplicate models now part of config module · 36ce7cb1
      David Runge authored
      repod/models/config.py:
      Remove config models, as they are now part of repod.config.settings.
      
      repod/models/__init__.py:
      Remove exposure of (now non-existent) config models.
      
      tests/test_models.py:
      Remove tests for config models.
      36ce7cb1
    • David Runge's avatar
      Move settings-only models to config module · 291dd5a6
      David Runge authored
      repod/config/settings.py:
      Copy `Architecture`, `Directory`, `ManagementRepo`, `PackagePool`,
      `PackageRepo`, `SourcePool` to repod.config.settings as they are only
      used in that context.
      
      tests/config/test_settings.py:
      Copy tests for added models.
      291dd5a6
    • David Runge's avatar
      move s · bc39ebd2
      David Runge authored
      bc39ebd2
    • David Runge's avatar
      Consolidate code with new config location · 7cd040aa
      David Runge authored
      repod/config/__init__.py:
      Add init file to expose the `repod.config.settings.Settings`.
      
      repod/config/settings.py:
      Turn imports from `repod.config.defaults` and `repod.models` into
      top-level imports.
      
      repod/files/__init__.py:
      Turn imports from `repod.config.defaults` into top-level imports.
      
      tests/config/test_config.py:
      Adapt import location for `repod.config.settings`.
      7cd040aa
    • David Runge's avatar
      Move configuration related files · a7fcb1a3
      David Runge authored
      Move the configuration related files config.py and defaults.py to a
      dedicated config module to be able to expose only parts of the
      functionality when importing it.
      Move tests to dedicated location for config.
      a7fcb1a3
  8. 14 Jun, 2022 2 commits