Skip to content

Better way to detect tools' path #919

@fannheyward

Description

@fannheyward

Couldn't the logic be something like this? If pythonPath has been resolved to something in a virtualenv (e.g. .venv/bin/python). Store const venvBinPath = path.dirname(pythonPath). And then when running mypy you first try path.join(venvBinPath, 'mypy'). And if that fails, look in $PATH?

You could maybe even do that logic during startup and save the absolute path to the binary so you don't have to run a subprocess twice in the global case.

Originally posted by @lithammer in #917 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions