Add dependency checks for Bazaar.

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

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.

Summary ID
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
Description From Last Updated

Want to add str while you're in here?

daviddavid

Docs don't match up with type annotations and implementation.

daviddavid
david
  1. 
      
  2. rbtools/clients/bazaar.py (Diff revision 1)
     
     

    Want to add str while you're in here?

    1. Yeah I'll do that. It's apparently inferred if assigned to a string initially, but better to be explicit.

  3. rbtools/clients/bazaar.py (Diff revision 1)
     
     
     
     
     
     
     
     
     
     
     
     

    Docs don't match up with type annotations and implementation.

  4. 
      
chipx86
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-4.x (8931f0e)
Loading...