- pyenv virtualenvironment
- Ansible provisioning / setup
- Unit Tests
- Travis Ci Integration
- preferred to have run
./local_build.sh
but to be precise, runpip intall -r requirements.txt
, requirements.txt contains the dependencies for the project.
- To Run the App
python stock_market.py
, usesapp.run(*args)
and start the service - losers and gainers endpoint also supports json, request json by passing query parameter
json=t or json=true
ansible-playbook -i 'vagrant@ip', setup.yml # Running for remote/vagrant maching
ansible-playbook -i 'localhost', setup.yml -c local # Running for remote/vagrant maching #To Run locally
pattern not required if you have tests with convention test_*.py
Add this to the localbuild.sh file
or set -e
in terminal. This exits the script if any command returns non-zero value or FAILS (echo $?).
This project mostly uses, exposes you to the following,
- Need For Environment?
- conflicts across libraries || python versions
- print "" fails in python3+
- generator.next() fails in python3+
- pyenv
pyenv versions
lists all python versions available (2.7, 3.2, 3.4.1 ...)pyenv shell
- to activate a specific python version (PYENV_VERSION)
- pyenv virtualenv
- install python version (
pyenv install 2.7
) - install virtualenvironment (
pyenv virtualenv 2.7 stock_env
) pyenv activate
to activate virtualenv or put virtualenv name in.python-version
file
- install python version (
- pip manages the dependency modules
pip list
show all modulespip freeze > requirements.txt
to update requirements file.
- Tests... Unit Tests... TDD! Try to Have more Tests/Test Coverage. No Documentation :)
- linters
- pep8, pyflakes, pylint
- basic service with flask
- ansible to setup projects
- file, name, main ...
- PYTHONVERBOSE, PYTHONPATH
export PYTHONVERBOSE="bla"
to have more debugging infounset PYTHONVERBOSE
to remove debugging info
Reference: