You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-8Lines changed: 22 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ All of these can be installed manually by clicking on the links above or you can
38
38
39
39
Alternately, you can use [Vagrant](https://www.vagrantup.com/) and [VirtualBox](https://www.virtualbox.org/) to create a consistent development environment in a virtual machine (VM).
40
40
41
-
You can read more about creating these environments in my article: [Creating Reproducable Development Environments](https://johnrofrano.medium.com/creating-reproducible-development-environments-fac8d6471f35)
41
+
You can read more about creating these environments in my article: [Creating Reproducible Development Environments](https://johnrofrano.medium.com/creating-reproducible-development-environments-fac8d6471f35)
42
42
43
43
## Bring up the development environment
44
44
@@ -95,7 +95,7 @@ coverage report -m
95
95
96
96
This is particularly useful because it reports the line numbers for the code that have not been covered so you know which lines you want to target with new test cases to get higher code coverage.
97
97
98
-
You can also manually run `pytest` with `coverage` (but `setup.cfg` does this already)
98
+
You can also manually run `pytest` with `coverage` (but settings in `pyporojrct.toml` do this already)
@@ -106,20 +106,33 @@ Try and get as close to 100% coverage as you can.
106
106
It's also a good idea to make sure that your Python code follows the PEP8 standard. Both `flake8` and `pylint` have been included in the `pyproject.toml` file so that you can check if your code is compliant like this:
flake8 service tests --count --select=E9,F63,F7,F82 --show-source --statistics
116
+
flake8 service tests --count --max-complexity=10 --max-line-length=127 --statistics
110
117
pylint service tests --max-line-length=127
111
118
```
112
119
113
120
Visual Studio Code is configured to use `pylint` while you are editing. This catches a lot of errors while you code that would normally be caught at runtime. It's a good idea to always code with pylint active.
114
121
115
122
## Running the service
116
123
117
-
The project uses *honcho* which gets it's commands from the `Procfile`. To start the service simply use:
124
+
The project uses `honcho` which gets it's commands from the `Procfile`. To start the service simply use:
118
125
119
126
```shell
120
127
honcho start
121
128
```
122
129
130
+
As a convenience you can aso use:
131
+
132
+
```shell
133
+
make run
134
+
```
135
+
123
136
You should be able to reach the service at: http://localhost:8000. The port that is used is controlled by an environment variable defined in the `.flaskenv` file which Flask uses to load it's configuration from the environment by default.
124
137
125
138
## Shutdown development environment
@@ -141,10 +154,11 @@ vagrant destroy
141
154
142
155
## What's featured in the project?
143
156
144
-
- app/routes.py -- the main Service routes using Python Flask
145
-
- app/models.py -- the data model using SQLAlchemy
146
-
- tests/test_routes.py -- test cases against the Pet service
147
-
- tests/test_models.py -- test cases against the Pet model
157
+
-`service/__init__.py` -- establishes the Flask app factory
158
+
-`service/routes.py` -- the main Service routes using Python Flask
159
+
-`service/models.py` -- the data model using SQLAlchemy
160
+
-`tests/test_routes.py` -- test cases against the Pet service
161
+
-`tests/test_models.py` -- test cases against the Pet model
0 commit comments