diff --git a/dev_requirements.in b/dev_requirements.in new file mode 100644 index 0000000..c3b3d70 --- /dev/null +++ b/dev_requirements.in @@ -0,0 +1,6 @@ +black +flake8 +invoke +pip-tools>=5.4.0 +pytest +requests \ No newline at end of file diff --git a/services/api/dev_requirements.txt b/dev_requirements.txt similarity index 81% rename from services/api/dev_requirements.txt rename to dev_requirements.txt index 328ebba..3c1d5a6 100644 --- a/services/api/dev_requirements.txt +++ b/dev_requirements.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile # To update, run: # -# pip-compile dev_requirements.in +# pip-compile --output-file=dev_requirements.txt dev_requirements.in # appdirs==1.4.3 # via black attrs==19.3.0 # via black, pytest @@ -13,11 +13,12 @@ click==7.0 # via black, pip-tools entrypoints==0.3 # via flake8 flake8==3.7.9 # via -r dev_requirements.in idna==2.8 # via requests +invoke==1.4.1 # via -r dev_requirements.in mccabe==0.6.1 # via flake8 more-itertools==8.2.0 # via pytest packaging==20.1 # via pytest pathspec==0.7.0 # via black -pip-tools==4.4.1 # via -r dev_requirements.in +pip-tools==5.4.0 # via -r dev_requirements.in pluggy==0.13.1 # via pytest py==1.8.1 # via pytest pycodestyle==2.5.0 # via flake8 @@ -31,3 +32,6 @@ toml==0.10.0 # via black typed-ast==1.4.1 # via black urllib3==1.25.8 # via requests wcwidth==0.1.8 # via pytest + +# The following packages are considered to be unsafe in a requirements file: +# pip diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..68dca4b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,11 @@ +[tool.black] +line-length = 100 +skip-string-normalization = true +target-version = ['py38'] +exclude = ''' +( + ^/\.git/ + | ^/build/ + | ^/node_modules/ +) +''' \ No newline at end of file diff --git a/services/api/dev_requirements.in b/services/api/dev_requirements.in deleted file mode 100644 index 51e72bb..0000000 --- a/services/api/dev_requirements.in +++ /dev/null @@ -1,5 +0,0 @@ -black -flake8 -pip-tools -pytest -requests \ No newline at end of file diff --git a/tasks.py b/tasks.py new file mode 100644 index 0000000..e21ccae --- /dev/null +++ b/tasks.py @@ -0,0 +1,9 @@ +from invoke import task + +UNVICORN_CMD = "uvicorn app.main:app --reload --workers 1 --host 0.0.0.0 --port 8000" + + +@task +def serve(c): + """Serves the fast_api app for local development""" + c.run(f"pushd services/api && {UNVICORN_CMD}")