forked from loafle/openapi-generator-original
* add multiple server support to python client * various fixes * minor fixes, add tests * test oas2 python first * fix tests * fix issues reported by flake8 * update code format * add python petstore to ensure up-to-date * rearrange test * fix E501 * fix tests * add new files * fix script permission * fix index check * update samples
34 lines
634 B
Bash
34 lines
634 B
Bash
#!/bin/bash
|
|
|
|
REQUIREMENTS_FILE=dev-requirements.txt
|
|
REQUIREMENTS_OUT=dev-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
|
|
source $VENV/bin/activate
|
|
DEACTIVE=true
|
|
fi
|
|
|
|
### install dependencies
|
|
pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT
|
|
python setup.py develop
|
|
|
|
### run tests
|
|
nosetests || exit 1
|
|
|
|
### static analysis of code
|
|
flake8 --show-source petstore_api/
|
|
|
|
### deactivate virtualenv
|
|
#if [ $DEACTIVE == true ]; then
|
|
# deactivate
|
|
#fi
|
|
|