more boilerplate

This commit is contained in:
Philipp Rothmann 2022-03-02 16:22:11 +01:00
parent a35d70412c
commit 1577ab18bc
6 changed files with 29 additions and 10 deletions

11
Makefile Normal file
View file

@ -0,0 +1,11 @@
init:
python3 -m venv env
. ./env/bin/activate
pip3 install -r requirements.txt
run:
./env/bin/uvicorn app.main:app --reload
test:
./env/bin/pytest app

View file

@ -7,11 +7,7 @@ does what nobody else want's to do.
### Getting Started
```
python3 -m venv env
. ./env/bin/activate
pip3 install -r requirements.txt
./env/bin/uvicorn app.main:app --reload
make init
make test
make run
```
pip freeze -l > requirements.txt

0
app/__init__.py Normal file
View file

View file

@ -5,4 +5,4 @@ app = FastAPI()
@app.get("/")
async def root():
return {"message": "Hello World"}
return {'message': 'Hello World'}

View file

@ -8,4 +8,4 @@ client = TestClient(app)
def test_read_main():
response = client.get("/")
assert response.status_code == 200
assert response.json() == {"msg": "Hello World"}
assert response.json() == {"message": "Hello World"}

View file

@ -1,11 +1,23 @@
anyio==3.5.0
asgiref==3.5.0
attrs==21.4.0
certifi==2021.10.8
charset-normalizer==2.0.12
click==8.0.4
fastapi==0.74.1
h11==0.13.0
idna==3.3
iniconfig==1.1.1
packaging==21.3
pluggy==1.0.0
py==1.11.0
pydantic==1.9.0
pyparsing==3.0.7
pytest==7.0.1
requests==2.27.1
sniffio==1.2.0
starlette==0.17.1
tomli==2.0.1
typing_extensions==4.1.1
urllib3==1.26.8
uvicorn==0.17.5