1. 09 Apr, 2021 1 commit
  2. 07 Apr, 2021 1 commit
    • David Runge's avatar
      Change repo_management to be async · 6f8cf758
      David Runge authored
      repo_managament/*:
      Remove the obsolete
      `convert._transform_package_desc_to_output_package()` (the functionality
      is now covered by pydantic models directly).
      Change all relevant methods to be async.
      Change file open commands to make use of aiofiles.
      
      tests/*:
      Remove tests for the obsolete
      `convert._transform_package_desc_to_output_package()`.
      Change all tests for async methods to test using pytest-asyncio.
      6f8cf758
  3. 18 Mar, 2021 1 commit
    • David Runge's avatar
      Add operation to create a db from JSON files · d1fa043d
      David Runge authored
      repo_management/operations.py:
      Add `create_db_from_json_files()` to create a repository database from
      JSON files in a directory.
      Change `db_file_as_models()` to rely on
      `models.PackageDesc.get_output_packages()` instead of
      `convert._transform_package_desc_to_output_package()` and add a missing
      parameter (base) to the instantiation of `models.OutputPackageBase()`.
      
      tests/test_operations.py:
      Add the two fixtures `dummy_json_files_in_dir()` and `empty_file()` to
      create a few (valid) dummy input JSON files in a temporary directory and
      an empty file (respectively).
      Add a test for `create_db_from_json_files()`.
      d1fa043d
  4. 09 Mar, 2021 1 commit
    • David Runge's avatar
      Remove Path checking from operations · 6099e271
      David Runge authored
      repo_management/operations.py:
      Remove the explicit Path checks from `dump_db_to_json_files()` as they
      are now generically implemented in argparse.ArgParseFactory.
      
      tests/test_operations.py
      Remove tests for Path checks in `dump_db_to_json_files()`.
      6099e271
  5. 08 Mar, 2021 2 commits
    • David Runge's avatar
      Add method to dump repo dbs to JSON files · 25b0c7ca
      David Runge authored
      repo_management/operations.py:
      Add `dump_db_to_json_files()` which allows for a repository database
      file to be read and all of its members to be serialized as JSON and
      written to files based upon the packages respective pkgbases.
      For the JSON serialization orjson is used, as it provides the highest
      speeds available and seems the most correct implementation.
      
      tests/test_operations.py:
      Add a fixture to create and destroy a temporary directory (used to write
      JSON files to).
      Add tests for `dump_db_to_json_files()`.
      25b0c7ca
    • David Runge's avatar
      Add iterator over repository database · 4e4d5bbe
      David Runge authored
      repo_management/operations.py:
      Add the public method `db_file_as_models()`, which yields all members of
      a repository database as a Tuple of the pkgbase name and the pkgbase
      data (represented as an instance of models.OutputPackageBase).
      
      tests/test_operations.py:
      Add a test for `db_file_as_models()`.
      4e4d5bbe