forked from loafle/openapi-generator-original
[python][fastapi] various minor improvements (#9672)
* fix python fastapi tests, update readme, add CI test * update FILES * use virtualenv * fix pom.xml * skip flake8
This commit is contained in:
33
samples/server/petstore/python-fastapi/test_python3.sh
Executable file
33
samples/server/petstore/python-fastapi/test_python3.sh
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
REQUIREMENTS_FILE=requirements.txt
|
||||
REQUIREMENTS_OUT=requirements.txt.log
|
||||
SETUP_OUT=*.egg-info
|
||||
VENV=.venv
|
||||
DEACTIVE=false
|
||||
|
||||
export LC_ALL=en_US.UTF-8
|
||||
export LANG=en_US.UTF-8
|
||||
|
||||
### set virtualenv
|
||||
if [ -z "$VIRTUAL_ENV" ]; then
|
||||
virtualenv $VENV --no-site-packages --always-copy --python python3
|
||||
source $VENV/bin/activate
|
||||
DEACTIVE=true
|
||||
fi
|
||||
|
||||
### install dependencies
|
||||
pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT
|
||||
|
||||
### run tests
|
||||
PYTHONPATH=src pytest tests
|
||||
|
||||
### static analysis of code
|
||||
#flake8 --show-source src/
|
||||
|
||||
### deactivate virtualenv
|
||||
if [ $DEACTIVE == true ]; then
|
||||
deactivate
|
||||
fi
|
||||
Reference in New Issue
Block a user