How to use the pythonfinder._vendor.pep514tools.environment function in pythonfinder

To help you get started, we’ve selected a few pythonfinder examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sarugaku / pythonfinder / src / pythonfinder / models / windows.py View on Github external
def get_versions(self):
        # type: () -> DefaultDict[Tuple, PathEntry]
        versions = defaultdict(PathEntry)  # type: DefaultDict[Tuple, PathEntry]
        from pythonfinder._vendor.pep514tools import environment as pep514env

        env_versions = pep514env.findall()
        path = None
        for version_object in env_versions:
            install_path = getattr(version_object.info, "install_path", None)
            if install_path is None:
                continue
            try:
                path = ensure_path(install_path.__getattr__(""))
            except AttributeError:
                continue
            try:
                py_version = PythonVersion.from_windows_launcher(version_object)
            except InvalidPythonVersion:
                continue
            if py_version is None:
                continue
            self.version_list.append(py_version)
github pypa / pipenv / pipenv / vendor / pythonfinder / models / windows.py View on Github external
def get_versions(self):
        versions = defaultdict(PathEntry)
        from pythonfinder._vendor.pep514tools import environment as pep514env

        env_versions = pep514env.findall()
        path = None
        for version_object in env_versions:
            install_path = getattr(version_object.info, "install_path", None)
            if install_path is None:
                continue
            try:
                path = ensure_path(install_path.__getattr__(""))
            except AttributeError:
                continue
            try:
                py_version = PythonVersion.from_windows_launcher(version_object)
            except InvalidPythonVersion:
                continue
            self.version_list.append(py_version)
            base_dir = PathEntry.create(
                path,