How to use the template:
- Create a template by clicking on the "Use this template" button. Make sure to select all branches
This will create a new repository with the given name e.g.
urban-potato
- Clone the repository locally
git clone git@github.com:pbashyal-nmdp/urban-potato.git cd urban-potato
- Make a virtual environment and activate it, run
make venv
> make venv python3 -m venv venv --prompt urban-potato-venv ===================================================================== To activate the new virtual environment, execute the following from your shell source venv/bin/activate
- Source the virtual environment
source venv/bin/activate
- Development workflow is driven through
Makefile
. Usemake
to list show all targets.> make clean remove all build, test, coverage and Python artifacts clean-build remove build artifacts clean-pyc remove Python file artifacts clean-test remove test and coverage artifacts lint check style with flake8 behave run the behave tests, generate and serve report pytest run tests quickly with the default Python test run all(BDD and unit) tests coverage check code coverage quickly with the default Python dist builds source and wheel package docker-build build a docker image for the service docker build a docker image for the service install install the package to the active Python's site-packages venv creates a Python3 virtualenv environment in venv activate activate a virtual environment. Run `make venv` before activating.
- Install all the development dependencies. Will install packages from all
requirements-*.txt
files.make install
- The Gherkin Feature files, step files and pytest files go in
tests
directory:tests |-- features | |-- algorithm | | `-- SLUG\ Match.feature | `-- definition | `-- Class\ I\ HLA\ Alleles.feature |-- steps | |-- HLA_alleles.py | `-- SLUG_match.py `-- unit `-- test_my_project_template.py
- Package Module files go in the
my_project_template
directory.my_project_template |-- __init__.py |-- algorithm | `-- match.py |-- model | |-- allele.py | `-- slug.py `-- my_project_template.py
- Run all tests with
make test
or different tests withmake behave
ormake pytest
.make behave
will generate report files and open the browser to the report. - Use
python app.py
to run the Flask service app in debug mode. Service will be available at http://localhost:8080/ - Use
make docker-build
to build a docker image using the currentDockerfile
. make docker
will build and run the docker image with the service. Service will be available at http://localhost:8080/