mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-03-08 07:09:30 +00:00
Support Deno installed via Python package (#15614)
* Add `deno` extra * Check Python "scripts" path for runtime executables Closes #15530 Authored by: zahlman, bashonly Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
This commit is contained in:
@@ -65,6 +65,9 @@ secretstorage = [
|
|||||||
"cffi",
|
"cffi",
|
||||||
"secretstorage",
|
"secretstorage",
|
||||||
]
|
]
|
||||||
|
deno = [
|
||||||
|
"deno>=2.6.5", # v2.6.5 fixes installation of incompatible binaries
|
||||||
|
]
|
||||||
build = [
|
build = [
|
||||||
"build",
|
"build",
|
||||||
"hatchling>=1.27.0",
|
"hatchling>=1.27.0",
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import dataclasses
|
|||||||
import functools
|
import functools
|
||||||
import os.path
|
import os.path
|
||||||
import sys
|
import sys
|
||||||
|
import sysconfig
|
||||||
|
|
||||||
from ._utils import _get_exe_version_output, detect_exe_version, version_tuple
|
from ._utils import _get_exe_version_output, detect_exe_version, version_tuple
|
||||||
|
|
||||||
@@ -13,6 +14,13 @@ _FALLBACK_PATHEXT = ('.COM', '.EXE', '.BAT', '.CMD')
|
|||||||
|
|
||||||
|
|
||||||
def _find_exe(basename: str) -> str:
|
def _find_exe(basename: str) -> str:
|
||||||
|
# Check in Python "scripts" path, e.g. for pipx-installed binaries
|
||||||
|
binary = os.path.join(
|
||||||
|
sysconfig.get_path('scripts'),
|
||||||
|
basename + sysconfig.get_config_var('EXE'))
|
||||||
|
if os.access(binary, os.F_OK | os.X_OK) and not os.path.isdir(binary):
|
||||||
|
return binary
|
||||||
|
|
||||||
if os.name != 'nt':
|
if os.name != 'nt':
|
||||||
return basename
|
return basename
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user