1. 21 Jul, 2022 2 commits
  2. 17 Jul, 2022 4 commits
  3. 16 Jul, 2022 4 commits
    • David Runge's avatar
      Integrate repository dirs with CLI · 7a5733d0
      David Runge authored
      repod/cli/argparse.py:
      Change the arguments for `repod-file package import`, `repod-file
      management import`, `repod-file management export`, `repod-file syncdb
      export`, `repod-file syncdb import` to include indicators for whether to
      target staging or testing repository and to clarify that repositories
      are targetted by name, instead of targetting paths.
      
      repod/cli/cli.py:
      Change `repod_file_package()`, `repod_file_management()` and
      `repod_file_syncdb()` to require a Settings instance as well as clearly
      specifying which repository is targetted (stable, staging or testing).
      
      tests/cli/test_cli.py:
      Change tests for `repod_file_package()`, `repod_file_management()` and
      `repod_file_syncdb()` to reflect the changes in functionality.
      Change integration tests to target the previously setup repositories for
      output and input instead of relying on dummy directories.
      7a5733d0
    • David Runge's avatar
      Add method to retrieve repository path from Settings · 012eb035
      David Runge authored
      repod/config/settings.py:
      Add `Settings.get_repo_path()` to retrieve a stable, staging or testing
      directory management or package repo of a tracked `PackageRepo` by name.
      
      tests/conftest.py:
      Add `usersettings` fixture to provide a UserSettings instance in tests.
      
      tests/config/test_settings.py:
      Add parametrized tests for `Settings.get_repo_path()`.
      012eb035
    • David Runge's avatar
      Add RepoTypeEnum to distinguish repository types · a8095161
      David Runge authored
      repod/common/enums.py:
      Add RepoTypeEnum with the members MANAGEMENT and PACKAGE to distinguish
      repository types.
      a8095161
    • David Runge's avatar
      Extend management repo dirs to staging and testing · 99e95731
      David Runge authored
      repod/config/settings.py:
      Rename PackageRepo._management_repo_dir to
      PackageRepo._stable_management_repo_dir and add
      PackageRepo._staging_maangement_repo_dir and
      PackageRepo._testing_management_repo_dir to provide the absolute paths
      to stable, staging and testing directories of a repository.
      
      tests/config/test_settings.py:
      Change `test_ensure_non_overlapping_repositories()` to also provide test
      cases in which staging and testing management repository directories
      reside in stable management repository directories.
      
      tests/conftest.py:
      Change fixture `packagerepo_in_tmp_path` to also populate the
      `_stable_management_repo_dir`, `_staging_management_repo_dir` and
      `_testing_management_repo_dir` private attributes.
      99e95731
  4. 13 Jul, 2022 8 commits
    • David Runge's avatar
      Ignore typing more specifically in repod.files.common · 13362b3f
      David Runge authored
      repod/files/common.py:
      Change `compression_type_of_tarfile()` to ignore typing issues more
      specifically.
      13362b3f
    • David Runge's avatar
      Evaluate settings when running repod-file · 24d75608
      David Runge authored
      repod/cli/cli.py:
      Change `repod_file()` to create an instance of `UserSettings` or
      `SystemSettings` (depending on ArgumentParser) to expose the configured
      repositories. Use `unittest.mock.patch` to override the default of
      `repod.config.settings.CUSTOM_CONFIG` if a custom configuration file is
      provided.
      
      tests/cli/test_cli.py:
      Change tests for `repod_file()` to also mock and check for calls to
      `SystemSettings` or `UserSettings`.
      Change `transform_databases()` to use a custom configuration file when
      calling `repod-file` to not interact with the user system (e.g.
      automatically create repository directories).
      24d75608
    • David Runge's avatar
      Allow override of config by custom file · 2c0ee4e8
      David Runge authored
      repod/config/settings.py:
      Add `CUSTOM_CONFIG` global which can be used to set a configuration file
      override.
      Change `PackageRepo.validate_name()` to not raise on name being an
      absolute Path or a directory structure, as this way an override of the
      default base locations is enabled.
      Change `read_toml_configuration_settings()` to only read an override
      configuration file, if it is specified using `CUSTOM_CONFIG`.
      Change `Settings.consolidate_repositories_with_defaults()` to properly
      handle `repo.name` being an absolute path when setting
      `repo._management_repo_dir`.
      
      tests/config/test_settings.py:
      Change `test_read_toml_configuration_settings_user()` to also test the
      case where a custom configuration file is provided.
      Remove obsolete/ invalid test cases from `test_package_repo()`.
      2c0ee4e8
    • David Runge's avatar
      Create directories for repositories in validation · db725846
      David Runge authored
      repod/config/defaults.py:
      Add default values DEFAULT_ARCHITECTURE and DEFAULT_NAME to provide
      default CPU architecture and name.
      Sort globals alphabetically.
      
      repod/config/settings.py:
      Add global `DIR_MODE` to provide a default octal string for directory
      permissions.
      Add `to_absolute_path()` to provide the means to turn a relative path
      into an absolute one using a provided base.
      Add `create_and_validate_directory()` to create directories and ensure
      that they are directories and writable.
      Add `Settings.validate_management_repo()` to create a default
      `ManagementRepo` if none is defined.
      Add `Settings.validate_repositories()` to create a default
      `PackageRepo` if none is defined.
      Add `Settings.consolidate_and_create_repositories()` which calls the new
      classmethods `consolidate_repositories_with_defaults()`,
      `ensure_non_overlapping_repositories()` and
      `create_repository_directories()` to consolidate and validate
      `PackageRepos` and create all relevant directories for them.
      Add default values for private attributes inherited from `Settings` to
      `SystemSettings` and `UserSettings`.
      Add `get_default_managementrepo()` to generate a default
      `ManagementRepo` based on `SettingsTypeEnum`.
      Change `Architecture` to be an optional CompressionTypeEnum, which
      allows for easier overrides when deriving from it in PackageRepo and
      Settings.
      Change `PackageRepo` to also derive from `DatabaseCompression` to allow
      per repository overrides.
      Change `PackageRepo` to add private attributes which are populated
      during validation of a `Settings` instance and used to define the
      absolute paths to all relevant repository locations.
      Change `raise_on_path_equals_other()` and `raise_on_path_in_other()` to
      fix formatting of f-string.
      Change `Settings` to carry private attributes, which must be overriden
      by derivative classes to set the default locations for repositories
      (e.g. per-user or system-wide configuration). Remove the
      `package_repo_base` and `source_repo_base` attributes, as they are
      superseded by the use of private attributes.
      Change `get_default_packagerepo()` to use default values instead of
      hardcoding them.
      Fix `read_toml_configuration_settings()` to properly combine the dicts
      created from reading TOML files.
      Remove `PackagePool.validate_package_pool()` as relevant validation
      takes place in the `Settings` validation.
      Remove `SourcePool.validate_source_pool()` as relevant validation
      takes place in the `Settings` validation.
      Remove `ManagementRepo.validate_directory()` as relevant validation
      takes place in the `Settings` validation.
      Remove `PackageRepo.validate_unique_package_pool_source_pool()` and
      `PackageRepo.validate_unique_management_repo_directory()` as relevant
      validation takes place in the `Settings` validation.
      Remove `Settings.validate_package_repo_base_source_repo_base()` as it is
      superseded by the new `consolidate_and_create_repositories()`
      root_validator.
      Remove `Settings.validate_existing_paths_for_repositories()` as it is
      superseded by the new `consolidate_and_create_repositories()`
      root_validator.
      Remove validators and additional attributes from `UserSettings` and
      `SystemSettings` as they are superseded by validation and defaults on
      the `Settings` class.
      Remove unneeded `UserManagementRepo` and `SystemManagemenRepo`.
      Remove superseded and functionally over-complex `validate_directory()`.
      
      tests/config/test_settings.py:
      Add tests for new `Settings` classmethods, helper methods and validators.
      
      tests/conftest.py:
      Add new fixture `packagerepo_in_tmp_path` which provides a PackageRepo
      with all attributes and private attributes populated.
      db725846
    • David Runge's avatar
      Use default PackageRepo for Settings if none is defined · 3489e897
      David Runge authored
      repod/config/__init__.py:
      expose SystemSettings and UserSettings instead of Settings, as the more
      specific versions provide respective default paths.
      
      repod/config/settings.py:
      Change `ManagementRepo` to only optionally require a URL, as it should
      be possible to add an upstream later.
      Add debug messages to `read_toml_configuration_settings()`.
      Change `Settings.repositories` to not default to an empty list, but to
      unset.
      Remove `Settings.validate_repositories()`, as its only purpose was to
      raise on no repositories defined.
      Add validators for `UserSettings.repositories` and
      `SystemSettings.repositories` that add a default PackageRepo if none is
      defined.
      Add `get_default_packagerepo()` to return a default PackageRepo
      depending on provided `SettingsTypeEnum`.
      
      tests/config/test_settings.py:
      Change tests for `SystemSettings` and `UserSettings` to not fail if no
      repository is set by patching the output of `get_default_packagerepo()`
      (the default directories are not created yet when trying to validate
      them).
      Add test for `get_default_packagerepo()`.
      3489e897
    • David Runge's avatar
      Adapt PACKAGE_POOL and SOURCE_POOL defaults to system/user setup · 98432ebb
      David Runge authored
      repod/config/defaults.py:
      Rename PACKAGE_POOL to PACKAGE_POOL_BASE and SOURCE_POOL to
      SOURCE_POOL_BASE.
      Turn PACKAGE_POOL_BASE and SOURCE_POOL_BASE into dicts, that provide
      user or system specific values based on SettingsTypeEnum key.
      98432ebb
    • David Runge's avatar
      Adapt config fixture to new config file suffix · ac22c2cf
      David Runge authored
      tests/conftest.py:
      Change `empty_toml_file` and `empty_toml_files_in_dir` fixtures to use
      `.conf` as file suffix, which reflects the current use of config files.
      ac22c2cf
    • David Runge's avatar
      Add top-level option to provide override config · c63ccdfc
      David Runge authored
      repod/cli/argparse.py:
      Add the `-c`/ `--config` option to allow providing an override
      configuration file loction.
      c63ccdfc
  5. 06 Jul, 2022 1 commit
  6. 04 Jul, 2022 6 commits
    • David Runge's avatar
      Add database compression to Settings · 47024842
      David Runge authored
      repod/config/settings.py:
      Add `DatabaseCompression` model which defaults to
      `DEFAULT_DATABASE_COMPRESSION`.
      Derive `Settings` also from `DatabaseCompression`.
      47024842
    • David Runge's avatar
      Distinguish between system and user Settings · 792fc646
      David Runge authored
      repod/config/defaults.py:
      Change `SETTINGS_LOCATION`, `SETTINGS_OVERRIDE_LOCATION`,
      `PACKAGE_REPO_BASE`, `SOURCE_REPO_BASE` and `MANAGEMENT_REPO` to
      distinguish between system and user level configuration with the help of
      SettingsTypeEnum.
      
      repod/config/settings.py:
      Remove the `directory` default value from `ManagementRepo`.
      Remove the `package_repo_base` and `source_repo_base` default values
      from `Settings`.
      Add SystemManagementRepo, UserManagementRepo, SystemSettings and
      UserSettings to distinguish between system and user-level configurations
      and defaults.
      
      tests/config/test_settings.py:
      Extend tests to cover user and system level setups.
      792fc646
    • David Runge's avatar
      Add enum to distinguish types of Settings · 8c9671f6
      David Runge authored
      repod/common/enums.py:
      Add Enum SettingsTypeEnum to distinguish user-level and system-level
      Settings objects.
      8c9671f6
    • David Runge's avatar
      Add python-pyxdg to package list · f8fa411d
      David Runge authored
      .gitlab-ci.yml:
      Add python-pyxdg to list of packages when running against system
      dependencies.
      f8fa411d
    • David Runge's avatar
      Update poetry lock file · a7ee2a17
      David Runge authored
      poetry.lock:
      Update poetry lock file after adding pyxdg.
      a7ee2a17
    • David Runge's avatar
      Add pyxdg to project dependencies · 43624406
      David Runge authored
      pyproject.toml:
      Add pyxdg to project dependencies to be able to rely on XDG compliant
      directories for configuration defaults.
      43624406
  7. 01 Jul, 2022 15 commits