use correct command for dev install command

This commit is contained in:
Izalia Mae 2024-06-14 13:29:55 -04:00
parent e44108f341
commit ed03779a11

20
dev.py
View file

@ -5,6 +5,7 @@ import shutil
import subprocess import subprocess
import sys import sys
import time import time
import tomllib
from datetime import datetime, timedelta from datetime import datetime, timedelta
from pathlib import Path from pathlib import Path
@ -29,19 +30,22 @@ IGNORE_EXT = {
@click.group('cli') @click.group('cli')
def cli(): def cli() -> None:
'Useful commands for development' 'Useful commands for development'
@cli.command('install') @cli.command('install')
def cli_install(): @click.option('--no-dev', '-d', is_flag = True, help = 'Do not install development dependencies')
cmd = [ def cli_install(no_dev: bool) -> None:
sys.executable, '-m', 'pip', 'install', with open('pyproject.toml', 'rb') as fd:
'-r', 'requirements.txt', data = tomllib.load(fd)
'-r', 'dev-requirements.txt'
]
subprocess.run(cmd, check = False) deps = data['project']['dependencies']
if not no_dev:
deps.extend(data['project']['optional-dependencies']['dev'])
subprocess.run([sys.executable, '-m', 'pip', 'install', '-U', *deps], check = False)
@cli.command('lint') @cli.command('lint')