simplified scripts with args and added basic docker cmds
This commit is contained in:
parent
bb4af4f16f
commit
4b53a99fc9
6
poetry.lock
generated
6
poetry.lock
generated
@ -159,7 +159,7 @@ unicode_backport = ["unicodedata2"]
|
|||||||
name = "click"
|
name = "click"
|
||||||
version = "8.0.1"
|
version = "8.0.1"
|
||||||
description = "Composable command line interface toolkit"
|
description = "Composable command line interface toolkit"
|
||||||
category = "dev"
|
category = "main"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=3.6"
|
python-versions = ">=3.6"
|
||||||
|
|
||||||
@ -170,7 +170,7 @@ colorama = {version = "*", markers = "platform_system == \"Windows\""}
|
|||||||
name = "colorama"
|
name = "colorama"
|
||||||
version = "0.4.4"
|
version = "0.4.4"
|
||||||
description = "Cross-platform colored terminal text."
|
description = "Cross-platform colored terminal text."
|
||||||
category = "dev"
|
category = "main"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
|
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
|
||||||
|
|
||||||
@ -933,7 +933,7 @@ multidict = ">=4.0"
|
|||||||
[metadata]
|
[metadata]
|
||||||
lock-version = "1.1"
|
lock-version = "1.1"
|
||||||
python-versions = "^3.8"
|
python-versions = "^3.8"
|
||||||
content-hash = "b655f310d9f4a561cd0ad1fb94769d088f90362763251b8500eab116cb9d599c"
|
content-hash = "54b44cd9c491f5cfd9ffc40d350fac513fb1e63c3c4fd3046aa19f66ebf372d5"
|
||||||
|
|
||||||
[metadata.files]
|
[metadata.files]
|
||||||
aiohttp = [
|
aiohttp = [
|
||||||
|
@ -9,6 +9,7 @@ python = "^3.8"
|
|||||||
web3 = "^5.21.0"
|
web3 = "^5.21.0"
|
||||||
pydantic = "^1.8.2"
|
pydantic = "^1.8.2"
|
||||||
hexbytes = "^0.2.1"
|
hexbytes = "^0.2.1"
|
||||||
|
click = "^8.0.1"
|
||||||
|
|
||||||
[tool.poetry.dev-dependencies]
|
[tool.poetry.dev-dependencies]
|
||||||
pre-commit = "^2.13.0"
|
pre-commit = "^2.13.0"
|
||||||
@ -29,14 +30,11 @@ build-backend = "poetry.core.masonry.api"
|
|||||||
lint = 'scripts.dev_tools:lint'
|
lint = 'scripts.dev_tools:lint'
|
||||||
test = 'scripts.dev_tools:test'
|
test = 'scripts.dev_tools:test'
|
||||||
isort = 'scripts.dev_tools:isort'
|
isort = 'scripts.dev_tools:isort'
|
||||||
isortcheck = 'scripts.dev_tools:isortcheck'
|
|
||||||
mypy = 'scripts.dev_tools:mypy'
|
mypy = 'scripts.dev_tools:mypy'
|
||||||
black = 'scripts.dev_tools:black'
|
black = 'scripts.dev_tools:black'
|
||||||
blackcheck = 'scripts.dev_tools:blackcheck'
|
start = 'scripts.docker:start'
|
||||||
start = 'scripts.dev_tools:start'
|
stop = 'scripts.docker:stop'
|
||||||
start_background = 'scripts.dev_tools:start_background'
|
build = 'scripts.docker:build'
|
||||||
stop = 'scripts.dev_tools:stop'
|
|
||||||
build = 'scripts.dev_tools:build'
|
|
||||||
|
|
||||||
[tool.black]
|
[tool.black]
|
||||||
exclude = '''
|
exclude = '''
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
from subprocess import check_call
|
import click
|
||||||
|
from subprocess import check_call, run
|
||||||
|
|
||||||
def lint():
|
def lint():
|
||||||
check_call(['pylint', '.'])
|
check_call(['pylint', '.'])
|
||||||
@ -6,30 +7,23 @@ def lint():
|
|||||||
def test():
|
def test():
|
||||||
check_call(['pytest', '--cov=mev_inspect', 'tests'])
|
check_call(['pytest', '--cov=mev_inspect', 'tests'])
|
||||||
|
|
||||||
def isort():
|
@click.command()
|
||||||
check_call(['isort', '.'])
|
@click.option('-c', required=False, is_flag=True)
|
||||||
|
def isort(c: str):
|
||||||
def isortcheck():
|
'''if c is present run isort in diff mode'''
|
||||||
check_call(['isort', '--diff', '.'])
|
if c:
|
||||||
|
check_call(['isort', '.'])
|
||||||
|
else:
|
||||||
|
check_call(['isort', '--diff', '.'])
|
||||||
|
|
||||||
def mypy():
|
def mypy():
|
||||||
check_call(['mypy', '.'])
|
check_call(['mypy', '.'])
|
||||||
|
|
||||||
def black():
|
@click.command()
|
||||||
check_call(['black', '.'])
|
@click.option('-c', required=False, is_flag=True)
|
||||||
|
def black(c: str):
|
||||||
def blackcheck():
|
'''if c is present run black in diff mode'''
|
||||||
check_call(['black', '--diff', '--color', '.'])
|
if c:
|
||||||
|
check_call(['black', '.'])
|
||||||
def start():
|
else:
|
||||||
check_call(['docker', 'compose', 'up'])
|
check_call(['black', '--diff', '--color', '.'])
|
||||||
|
|
||||||
def start_background():
|
|
||||||
check_call(['docker', 'compose', 'up', '-d'])
|
|
||||||
|
|
||||||
def stop():
|
|
||||||
check_call(['docker', 'compose', 'down'])
|
|
||||||
|
|
||||||
def build():
|
|
||||||
check_call(['docker', 'compose', 'build'])
|
|
||||||
|
|
||||||
|
19
scripts/docker.py
Normal file
19
scripts/docker.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import click
|
||||||
|
from subprocess import check_call, run
|
||||||
|
from typing import List
|
||||||
|
|
||||||
|
@click.command()
|
||||||
|
@click.option('-b', required=False, is_flag=True)
|
||||||
|
def start(b: str):
|
||||||
|
'''if d is present background compose'''
|
||||||
|
if b:
|
||||||
|
check_call(['docker', 'compose', 'up', '-d'])
|
||||||
|
click.echo('docker running in the background...')
|
||||||
|
else:
|
||||||
|
check_call(['docker', 'compose', 'up'])
|
||||||
|
|
||||||
|
def stop():
|
||||||
|
check_call(['docker', 'compose', 'down'])
|
||||||
|
|
||||||
|
def build():
|
||||||
|
check_call(['docker', 'compose', 'build'])
|
Loading…
x
Reference in New Issue
Block a user