[~] add host_deps command

This commit is contained in:
Siarhei Siniak 2024-11-24 19:47:36 +03:00
parent cadec5376a
commit bd9878335a
3 changed files with 17 additions and 3 deletions

@ -1,3 +1,6 @@
host_deps:
./m host_deps
python_clean:
rm -fr \
~/.local/bin/env3 \

14
_m.py

@ -259,9 +259,17 @@ def inside_env() -> bool:
# ruff = 'ruff'
# m2 = 'm2'
Command_args = ['js', 'mypy', 'env', 'ruff', 'm2']
def host_deps(argv: list[str]) -> None:
if sys.platform in ['linux']:
subprocess.check_call(r'''
exec yay -S $(cat requirements-archlinux.txt)
''', shell=True,)
else:
raise NotImplementedError
Command : TypeAlias = Literal['js', 'mypy', 'env', 'ruff', 'm2']
Command_args = ['js', 'mypy', 'env', 'ruff', 'm2', 'host_deps',]
Command : TypeAlias = Literal['js', 'mypy', 'env', 'ruff', 'm2', 'host_deps',]
def run(argv: Optional[list[str]] = None) -> None:
logging.basicConfig(
@ -297,6 +305,8 @@ def run(argv: Optional[list[str]] = None) -> None:
if options.command == 'js':
js(args)
elif options.command == 'host_deps':
host_deps(args)
elif options.command == 'env':
env(args)
elif options.command == 'mypy':

@ -0,0 +1 @@
python-build