(self)
return to_install
Checks whether the given packages are installed.

        The value for each package is the version specification.
Checks whether the given packages are installed.
Checks whether the given packages are installed .
def _packages_installed(self) -> Dict[str, SimpleSpec]:
        """
        Checks whether the given packages are installed.

        The value for each package is the version specification.
        """
        installed: Dict[str, Version] = {}
        for package in json.loads(
            self.venv_exec([*PythonTool.PIP_CMD, "list", "--format", "json"])
        ):
            try:
                installed[package["name"]] = Version(package["version"])
            except ValueError:
                # skip it
                pass

        to_install: Dict[str, SimpleSpec] = {}
        for name, spec in self.required_packages().items():
            if name not in installed or not spec.match(installed[name]):
                to_install[name] = spec
        return to_install
def _packages_installed ( self ) -> Dict [ str , SimpleSpec ] : installed : Dict [ str , Version ] = { } for package in json . loads ( self . venv_exec ( [ * PythonTool . PIP_CMD , "list" , "--format" , "json" ] ) ) : try : installed [ package [ "name" ] ] = Version ( package [ "version" ] ) except ValueError : # skip it pass to_install : Dict [ str , SimpleSpec ] = { } for name , spec in self . required_packages ( ) . items ( ) : if name not in installed or not spec . match ( installed [ name ] ) : to_install [ name ] = spec return to_install