mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-22 22:48:00 +00:00
use correct command for dev install command
This commit is contained in:
parent
e44108f341
commit
ed03779a11
20
dev.py
20
dev.py
|
@ -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')
|
||||||
|
|
Loading…
Reference in a new issue