How to use the pythonfinder.models 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 / tests / test_python.py View on Github external
def test_shims_are_removed(monkeypatch, setup_pythons):
    with monkeypatch.context() as m:
        pyenv_dir = pythonfinder.utils.normalize_path("./.pyenv")
        asdf_dir = pythonfinder.utils.normalize_path("./.asdf")
        six.moves.reload_module(pythonfinder.environment)
        six.moves.reload_module(pythonfinder.models.path)
        if "VIRTUAL_ENV" in os.environ:
            os_path = os.environ["PATH"].split(os.pathsep)
            env_path = next(
                iter(
                    p
                    for p in os_path
                    if pythonfinder.utils.is_in_path(p, os.environ["VIRTUAL_ENV"])
                ),
                None,
            )
            if env_path is not None:
                os_path.remove(env_path)
                os.environ["PATH"] = os.pathsep.join(os_path)
            del os.environ["VIRTUAL_ENV"]
        m.setattr(
            pythonfinder.environment,