- 24 Jun, 2022 1 commit
-
-
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()`.
-
- 21 Jun, 2022 1 commit
-
-
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.
-
- 19 Jun, 2022 2 commits
-
-
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.
-
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.
-
- 18 Jun, 2022 18 commits
-
-
David Runge authored
docs/packages/contents.rst: Add documentation about Package and include PackageV1 JSON schema.
-
David Runge authored
tox.ini: Export JSON schema for PackageV1 in docs target.
-
David Runge authored
repod/files/buildinfo.py: Remove `read_buildinfo()` as it is superseded by `repod.files.common.read_file_from_tarfile`. repod/files/mtree.py: Remove `read_mtree()` as it is superseded by `repod.files.common.read_file_from_tarfile`. repod/files/pkginfo.py: Remove `read_pkginfo()` as it is superseded by `repod.files.common.read_file_from_tarfile`. tests/files/test_{buildinfo,mtree,pkginfo}.py: Remove tests for removed functions. Adapt integration tests to make use of `repod.files.common.read_file_from_tarfile`.
-
David Runge authored
repod/files/package.py: Add integration for reading and representing package data in a versioned `Package` model. tests/files/test_package.py: Add tests for `Package.from_file()`. repod/files/__init__.py: Expose repod.files.package.Package.
-
David Runge authored
repod/files/common.py: Extend `extract_file_from_tarfile()` to optionally return the extracted file contents in a StringIO and to deal with extracting from gzip compressed files in the tarfile. Add `names_in_tarfile()` to check whether all strings in a list or set are found in the list of filenames in a tarfile. tests/files/test_common.py: Parametrize the test for `extract_file_from_tarfile()`. Add parametrized tests for `names_in_tarfile()`.
-
David Runge authored
tests/conftest.py: Ensure to not add empty lines to StringIO representations of .PKGINFO files.
-
David Runge authored
repod/files/pkginfo.py: Try/except ValueError when evaluating .PKGINFO lines in `PkgInfo.from_file()` and raise a RepoManagementFileError instead. Add debug message about which line is being processed. tests/files/test_pkginfo.py: Raise on more invalid lines when testing `PkgInfo.from_file()` and also show debug log output.
-
David Runge authored
tests/conftest.py: Add fixture for a default package file, containing .BUILDINFO, .MTREE and .PKGINFO file.
-
David Runge authored
pyproject.toml: Add metadata which is needed for releases on pypi.org.
-
David Runge authored
.gitlab-ci.yml: Move linting to a check stage, which runs first. Only download files databases for integration tests. Run regex tests in a separate test job. Add variables to track required packages for various use-cases (e.g. tests in a locked poetry context, tests using system packages). Add build stage to run a job that uses poetry to build the sdist and wheel of the package. Add publish stage which runs a publish job if the commit is a tagged commit (relying on API token for pypi.org). Add jobs to test the project using system dependencies.
-
David Runge authored
tox.ini: Add tox testenv "regex" for regular expression tests.
-
David Runge authored
tests/common/test_regex.py: Mark all regular expression tests with "regex".
-
David Runge authored
pyproject.toml: Extend known pytest marks by "regex" for regular expression tests. Ignore regex as well as integration tests for default pytest calls.
-
David Runge authored
* artafinde/macos-support: Add coverage-conditional-plugin to assist in coverage Parameterize the parameters based on platform Create different venvs for different platforms
-
Leonidas Spyropoulos authored
Since some code branches cannot be executed in certain platforms we should skip them to not polute the coverage. Signed-off-by:
Leonidas Spyropoulos <artafinde@archlinux.org>
-
Leonidas Spyropoulos authored
Disable the pyalpm_vercmp code branch for non-linux platforms Signed-off-by:
Leonidas Spyropoulos <artafinde@archlinux.org>
-
Leonidas Spyropoulos authored
Signed-off-by:
Leonidas Spyropoulos <artafinde@archlinux.org>
-
David Runge authored
repod/config/settings.py: Add the top-level validator function `validate_directory()` instead of relying on a Directory model and a pydantic validator. This way it is possible to set a default for ManagementRepo.directory. Remove unneeded Directory model. tests/config/test_settings.py: Adapt tests for `Directory.validate_directory()` for `validate_directory()`.
-
- 17 Jun, 2022 8 commits
-
-
Levente Polyak authored
There were multiple shortcomings with the current implementation compared to the behavior of the official libalpm implementation. One of the primary differences requires a version segment to be handled chunk by chunk whether its numeric or none numeric. Furthermore differences in segment separators (none alpha-numeric characters) requires special handling to get the same results as libalpm. As there are just too many edge cases this changes implements the original libalpm vercmp algorithm as is. Furthermore move everything out of `models.py` into an own version module which is included. This will make it tremendously easier to potentially support multiple version schemas for different consumers in the future. Fixes #63 Signed-off-by:
Levente Polyak <anthraxx@archlinux.org>
-
David Runge authored
tests/common/test_regex.py: Test against valid/invalid compression type fixtures in regular expression tests.
-
David Runge authored
tests/conftest.py: Add session wide fixtures for valid/ invalid compression types.
-
David Runge authored
repod/common/enums.py: Change return value of `tar_compression_types_for_filename_regex()` to properly match dot prefixed file endings (e.g. `.gz`) and not any other prefix character.
-
David Runge authored
tox.ini: Increase the verbosity of integration test runs again.
-
David Runge authored
tests/files/test_{buildinfo,mtree}.py: Lookup local packages for tests in a compression type agnostic fashion (using all supported compression types).
-
It's nice to support both modules that stand in conflict with each other. Instead of forcing a specific implementation, we instead provide a tiny compatibility check and act differently while loading the string representation of the file type. Signed-off-by:
Levente Polyak <anthraxx@archlinux.org>
-
-
- 16 Jun, 2022 2 commits
-
-
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.
-
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.
-
- 15 Jun, 2022 6 commits
-
-
David Runge authored
repod/config/settings.py: Use `repod.config.defaults.MANAGEMENT_REPO` as default directory for the `ManagementRepo` model.
-
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.
-
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.
-
David Runge authored
-
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`.
-
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.
-
- 14 Jun, 2022 2 commits
-
-
David Runge authored
docs/packages/contents.rst: Add documentation about .PKGINFO files, including JSON schema for PkgInfo.
-
David Runge authored
tox.ini: Also export the PkgInfo JSON schema when creating documentation.
-