/
niceSOFT
/
python3-hatchling
Обзор
Документация
Войти
/
niceSOFT
/
python3-hatchling
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/hatch/cli/python/find.py
24 строки
835 B
Dimitri Papadopoulos Orfanos
Upgrade Ruff to 0.13.2 (#1890)
28 сен 2025, 21:20
Не верифицирован
28 сен 2025, 21:20
aff6f39
Код
Авторство
О чём код?
from __future__ import annotations from typing import TYPE_CHECKING import click if TYPE_CHECKING: from hatch.cli.application import Application @click.command(short_help="Locate Python binaries") @click.argument("name") @click.option("-p", "--parent", is_flag=True, help="Show the parent directory of the Python binary") @click.option("--dir", "-d", "directory", help="The directory in which distributions reside") @click.pass_obj def find(app: Application, *, name: str, parent: bool, directory: str | None): """Locate Python binaries.""" manager = app.get_python_manager(directory) installed = manager.get_installed() if name not in installed: app.abort(f"Distribution not installed: {name}") dist = installed[name] app.display(str(dist.python_path.parent if parent else dist.python_path))