1. 22 Mar, 2021 1 commit
    • David Runge's avatar
      Add documentation to all models · 9fa1d0e0
      David Runge authored
      repo_management/models.py:
      Document all models and sort the single attribute models alphabetically
      for easier readibility.
      Change the `License` model to describe a required attribute instead of
      an optional (all packages need a license).
      Remove the unused model `PackageFiles`.
      9fa1d0e0
  2. 18 Mar, 2021 1 commit
    • David Runge's avatar
      Correct and extend models and defaults · 5c491242
      David Runge authored
      repo_management/defaults.py:
      Add the IntEnum `RepoDbType` to be able to identify/address the
      different types of binary database files (e.g. .db vs. .files).
      Change the %LICENSE% entry in `DESC_JSON` to not track the name in
      plural (use "license" instead of "licenses") to stay in line with the
      naming of the original variable.
      Add `DB_USER`, `DB_GROUP`, `DB_FILE_MODE`, `DB_DIR_MODE`, to provide
      defaults for which user and group to create files and directories with
      which file mode for, when generating a database file.
      
      repo_management/models.py:
      Change the `License` model to track an optional list of license
      identifiers using the singular term ("license" instead of "licenses") to
      have more predictable and coherent naming of variables and attributes.
      Add `Base` to `OutputPackageBase` as this way the model is more complete
      and it becomes much easier to use it, without having to also pass the
      pkgbase alongside it.
      Add the convenience method `get_packages_as_models()` to
      `OutputPackageBase` which returns the list of packages as tuples of
      `PackageDesc` and `Files`.
      Extend `PackageDesc` by the convenience method `get_output_package()` to
      easily convert an instance of `PackageDesc` and an optional instance of
      `Files` to an instance of `OutputPackage`.
      Move the declaration of `OutputPackage` above that of `PackageDesc` so
      that `PackageDesc.get_output_package()` can declare typing.
      
      tests/test_models.py
      Add tests for `PackageDesc.get_output_package()` and
      `OutputPackageBase.get_packages_as_models()`.
      5c491242
  3. 08 Mar, 2021 1 commit
    • David Runge's avatar
      Add models for describing output facing package data · f549d51a
      David Runge authored
      repo_management/models.py:
      Add model `PackageFiles` to track the list of files for a given package.
      Add model `RepoDbMemberType` to track the type of a repository database
      member (distinguished by the IntEnum defaults.RepoDbMemberType).
      Add model `RepoDbMemberData` to track the data (represented by an
      io.StringIO instance) of a repository database member.
      Add model `OutputPackage` to track the attributes required for a single
      package in the context of a representation within its pkgbase.
      Add model `OutputPackageBase` to track the attributes required for a
      pkgbase and its list of packages.
      f549d51a
  4. 07 Mar, 2021 1 commit
    • David Runge's avatar
      Add pydantic models for 'desc' and 'files' files · 72cfd707
      David Runge authored
      repo_management/models.py:
      Add pydantic models for all headers in 'desc' and 'files' files (found
      in a repository database per pkgbase).
      The models describe the attribute names in use when reading data from
      the respective files and whether they are required or not.
      72cfd707