Skip to content

Commit 33b03dd

Browse files
committed
Added README.md to describe how to use the template.
1 parent 86ea621 commit 33b03dd

File tree

1 file changed

+72
-10
lines changed

1 file changed

+72
-10
lines changed

README.md

Lines changed: 72 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,76 @@ My Project Template
22
===================
33

44

5+
How to use the template:
56

6-
Features
7-
--------
8-
9-
* Match SLUGs
10-
11-
12-
13-
LICENSE
14-
-------
15-
* Free software: LGPL 3.0
7+
1. Create a template by clicking on the "Use this template" button. Make sure to select all branches
8+
This will create a new repository with the given name
9+
2. Clone the repository locally
10+
```shell
11+
git clone [email protected]:pbashyal-nmdp/urban-potato.git
12+
cd urban-potato
13+
```
14+
3. Make a virtual environment and activate it, run `make venv`
15+
```shell
16+
> make venv
17+
python3 -m venv venv --prompt urban-potato-venv
18+
=====================================================================
19+
To activate the new virtual environment, execute the following from your shell
20+
source venv/bin/activate
21+
```
22+
4. Source the virtual environment
23+
```shell
24+
source venv/bin/activate
25+
```
26+
5. Development workflow is driven through `Makefile`. Use `make` to list show all targets.
27+
```
28+
> make
29+
clean remove all build, test, coverage and Python artifacts
30+
clean-build remove build artifacts
31+
clean-pyc remove Python file artifacts
32+
clean-test remove test and coverage artifacts
33+
lint check style with flake8
34+
behave run the behave tests, generate and serve report
35+
pytest run tests quickly with the default Python
36+
test run all(BDD and unit) tests
37+
coverage check code coverage quickly with the default Python
38+
dist builds source and wheel package
39+
docker-build build a docker image for the service
40+
docker build a docker image for the service
41+
install install the package to the active Python's site-packages
42+
venv creates a Python3 virtualenv environment in venv
43+
activate activate a virtual environment. Run `make venv` before activating.
44+
```
45+
6. Install all the development dependencies. Will install packages from all `requirements-*.txt` files.
46+
```shell
47+
make install
48+
```
49+
7. The Gherkin Feature files, step files and pytest files go in `tests` directory:
50+
```
51+
tests
52+
|-- features
53+
| |-- algorithm
54+
| | `-- SLUG\ Match.feature
55+
| `-- definition
56+
| `-- Class\ I\ HLA\ Alleles.feature
57+
|-- steps
58+
| |-- HLA_alleles.py
59+
| `-- SLUG_match.py
60+
`-- unit
61+
`-- test_my_project_template.py
62+
```
63+
8. Package Module files go in the `my_project_template` directory.
64+
```
65+
my_project_template
66+
|-- __init__.py
67+
|-- algorithm
68+
| `-- match.py
69+
|-- model
70+
| |-- allele.py
71+
| `-- slug.py
72+
`-- my_project_template.py
73+
```
74+
9. Run all tests with `make test` or different tests with `make behave` or `make pytest`. `make behave` will generate report files and open the browser to the report.
75+
10. Use `python app.py` to run the Flask service app in debug mode. Service will be available at http://localhost:8080/
76+
11. Use `make docker-build` to build a docker image using the current `Dockerfile`.
77+
12. `make docker` will build and run the docker image with the service. Service will be available at http://localhost:8080/

0 commit comments

Comments
 (0)