Add API for working with data from a package repository.
Review Request #7693 — Created Oct. 11, 2015 and submitted
This introduces a set of classes for serializing/deserializing package
data stored in a repository, and classes for interacting with the
repository. It can be used to query packages, the available versions,
installation instructions, and more.Each entry in the repository is a
PackageBundle
, which bundles together
a list of channels (PackageChannel
). Each of these manages state for a
range of versions (1.0.x, 1.5.x, 2.0.x, etc.), and may also be mapped to
one or more aliases (beta, stable, etc.).Each channel lists all available releases (
PackageChannel
), and also
contains rules (PackageRules
) on how to install any given version.These objects are populated with data from the repository through
deserialization class methods that they provide. That data comes from a
PackageDataLoader
subclass, which knows how to fetch and deserialize
JSON data from a backend (the main package repository, a testing
repository, etc.).Currently, there's no data loader implemented to talk to any
HTTPS-backed repository, nor are there any classes for
managing/installing packages beyond fetching data on them. Those will
come in future changes.
Unit tests pass.
Implemented a test command locally, and used it to introspect package data.
- Change Summary:
-
- Split the classes into their own files.
__init__
on each class now takes arguments to set the attributes, and call sites have been updated to use that.- Renamed
PackageVersionSeries
toPackageChannel
. - Renamed
PackageVersion
toPackageRelease
.
- Description:
-
This introduces a set of classes for serializing/deserializing package
data stored in a repository, and classes for interacting with the repository. It can be used to query packages, the available versions, installation instructions, and more. Each entry in the repository is a
PackageBundle
, which bundles together~ a list of version series ( PackageVersionSeries
). Each of these manages~ state for a range of versions (1.0.x, 1.5.x, 2.0.x, etc.), and may also ~ be mapped to one or more aliases (beta, stable, etc.). ~ a list of channels ( PackageChannel
). Each of these manages state for a~ range of versions (1.0.x, 1.5.x, 2.0.x, etc.), and may also be mapped to ~ one or more aliases (beta, stable, etc.). ~ Each version series lists all available versions in that series
~ ( PackageVersion
), and also contains rules (PackageRules
) on how to~ Each channel lists all available releases (
PackageChannel
), and also~ contains rules ( PackageRules
) on how to install any given version.- install any given version. These objects are populated with data from the repository through
deserialization class methods that they provide. That data comes from a PackageDataLoader
subclass, which knows how to fetch and deserializeJSON data from a backend (the main package repository, a testing repository, etc.). Currently, there's no data loader implemented to talk to any
HTTPS-backed repository, nor are there any classes for managing/installing packages beyond fetching data on them. Those will come in future changes.
-
Tool: PEP8 Style Checker Processed Files: rbpkg/api/loaders.py rbpkg/api/tests/test_package_channel.py rbpkg/api/tests/testcases.py rbpkg/api/tests/test_package_rules.py rbpkg/api/package_bundle.py rbpkg/api/package_channel.py rbpkg/api/errors.py rbpkg/api/package_rules.py rbpkg/api/tests/test_package_release.py rbpkg/api/package_release.py rbpkg/api/package_repo.py setup.py rbpkg/api/tests/test_package_bundle.py Ignored Files: rbpkg/api/__init__.py rbpkg/api/tests/__init__.py Tool: Pyflakes Processed Files: rbpkg/api/loaders.py rbpkg/api/tests/test_package_channel.py rbpkg/api/tests/testcases.py rbpkg/api/tests/test_package_rules.py rbpkg/api/package_bundle.py rbpkg/api/package_channel.py rbpkg/api/errors.py rbpkg/api/package_rules.py rbpkg/api/tests/test_package_release.py rbpkg/api/package_release.py rbpkg/api/package_repo.py setup.py rbpkg/api/tests/test_package_bundle.py Ignored Files: rbpkg/api/__init__.py rbpkg/api/tests/__init__.py
-
-
Tool: Pyflakes Processed Files: rbpkg/api/loaders.py rbpkg/api/tests/test_package_channel.py rbpkg/api/tests/testcases.py rbpkg/api/tests/test_package_rules.py rbpkg/api/package_bundle.py rbpkg/api/package_channel.py rbpkg/api/errors.py rbpkg/api/package_rules.py rbpkg/api/tests/test_package_release.py rbpkg/api/package_release.py rbpkg/api/package_repo.py setup.py rbpkg/api/tests/test_package_bundle.py Ignored Files: rbpkg/api/__init__.py rbpkg/api/tests/__init__.py Tool: PEP8 Style Checker Processed Files: rbpkg/api/loaders.py rbpkg/api/tests/test_package_channel.py rbpkg/api/tests/testcases.py rbpkg/api/tests/test_package_rules.py rbpkg/api/package_bundle.py rbpkg/api/package_channel.py rbpkg/api/errors.py rbpkg/api/package_rules.py rbpkg/api/tests/test_package_release.py rbpkg/api/package_release.py rbpkg/api/package_repo.py setup.py rbpkg/api/tests/test_package_bundle.py Ignored Files: rbpkg/api/__init__.py rbpkg/api/tests/__init__.py