Add dependency checks for Bazaar.

Review Request #12544 — Created Aug. 18, 2022 and submitted — Latest diff uploaded

Information

RBTools
release-4.x

Reviewers

This updates BazaarClient to add formal support for dependency checks.
BazaarClient.check_dependencies() now determines if Breezy or Bazaar
is installed, and sets appropriate flags for the tool to use.

The bzr and is_breezy attributes have become properties, which will
trigger a dependency check if one is not performed. Similarly,
get_local_path() will also perform a dependency check if needed. This
is all in case of legacy usage where these are accessed before calling
setup() or has_dependencies(). In RBTools 5, these will instead
raise an exception.

Unit tests have been updated to include new dependency-related tests.
They also now leverage the dependency checks, rather than duplicating
checks or working around the different names of the tool. Tests that
require a working client will be skipped if missing a dependency.

Unit tests pass on Python 3.7 through 3.11.

Tested with Breezy installed, with Bazaar installed, and with neither
installed.

Diff Revision 2 (Latest)

orig
1
2

Commits

First Last Summary ID Author
Add dependency checks for Bazaar.
This updates `BazaarClient` to add formal support for dependency checks. `BazaarClient.check_dependencies()` now determines if Breezy or Bazaar is installed, and sets appropriate flags for the tool to use. The `bzr` and `is_breezy` attributes have become properties, which will trigger a dependency check if one is not performed. Similarly, `get_local_path()` will also perform a dependency check if needed. This is all in case of legacy usage where these are accessed before calling `setup()` or `has_dependencies()`. In RBTools 5, these will instead raise an exception. Unit tests have been updated to include new dependency-related tests. They also now leverage the dependency checks, rather than duplicating checks or working around the different names of the tool. Tests that require a working client will be skipped if missing a dependency.
51cbcffc36de098dd18395ab5c80e8353d92a9e8 Christian Hammond
rbtools/clients/bazaar.py
rbtools/clients/base/scmclient.py
rbtools/clients/tests/test_bzr.py
rbtools/clients/tests/testdata/homedir/.gitignore
Loading...