Blazemeter / taurus

@@ -52,17 +52,34 @@
Loading
52 52
        self.pip_cmd = [self.interpreter, "-m", "pip"]
53 53
54 54
    def _missed(self, packages):
55 -
        # todo: add version handling
56 55
        cmdline = self.pip_cmd + ["list"]
57 56
        out, _ = exec_and_communicate(cmdline)
58 -
        list_of_installed = [line.split(' ')[0] for line in out.split('\n')[2:-1]]
57 +
        out = out.split('\n')[2:-1]
58 +
        installed = dict(zip([line.split(' ')[0] for line in out], [line.split(' ')[-1] for line in out]))
59 59
60 60
        missed = []
61 61
        for package in packages:
62 -
            if package not in list_of_installed:
62 +
            if package not in installed or package in self.versions and installed[package] != self.versions[package]:
63 63
                missed.append(package)
64 64
        return missed
65 65
66 +
    def _convert_config_versions(self):
67 +
        packages_list = self.parameters.get("packages", None)
68 +
        if not packages_list:
69 +
            return self.packages
70 +
71 +
        for package_data in packages_list:
72 +
            package, version = None, None
73 +
            if isinstance(package_data, dict):
74 +
                package, version = package_data['name'], package_data.get("version", None)
75 +
            elif isinstance(package_data, str):
76 +
                package_params = package_data.split("==")
77 +
                package, version = package_params[0], package_params[1] if len(package_params) > 1 else None
78 +
79 +
            self.packages.append(package)
80 +
            if version:
81 +
                self.versions[package] = version
82 +
66 83
    def _uninstall(self, packages):
67 84
        pass  # todo:
68 85
@@ -78,7 +95,7 @@
Loading
78 95
          - first_pkg
79 96
          - second_pkg
80 97
        """
81 -
        self.packages = self.parameters.get("packages", self.packages)
98 +
        self._convert_config_versions()
82 99
        if not self.packages:
83 100
            return
84 101
        self.versions = self.parameters.get("versions", self.versions)
Files Coverage
bzt 90.31%
Project Totals (68 files) 90.31%
9533.2
TRAVIS_PYTHON_VERSION=3.8
TRAVIS_OS_NAME=linux
1
codecov:
2
  notify:
3
    require_ci_to_pass: yes
4

5
coverage:
6
  round: up
7

8
ignore:
9
  - bzt/resources
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading