Skip to content

Commit d940941

Browse files
committed
Mintor cleanup of commands
1 parent 3da0cd2 commit d940941

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

README.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ All of these can be installed manually by clicking on the links above or you can
3838

3939
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).
4040

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)
4242

4343
## Bring up the development environment
4444

@@ -95,7 +95,7 @@ coverage report -m
9595

9696
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.
9797

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)
9999

100100
```shell
101101
$ pytest --pspec --cov=service --cov-fail-under=95
@@ -106,20 +106,33 @@ Try and get as close to 100% coverage as you can.
106106
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:
107107

108108
```shell
109-
flake8 . --count --max-complexity=10 --max-line-length=127 --statistics
109+
make lint
110+
```
111+
112+
Which does the equivalent of these commands:
113+
114+
```shell
115+
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
110117
pylint service tests --max-line-length=127
111118
```
112119

113120
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.
114121

115122
## Running the service
116123

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:
118125

119126
```shell
120127
honcho start
121128
```
122129

130+
As a convenience you can aso use:
131+
132+
```shell
133+
make run
134+
```
135+
123136
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.
124137

125138
## Shutdown development environment
@@ -141,10 +154,11 @@ vagrant destroy
141154

142155
## What's featured in the project?
143156

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
148162

149163
## License
150164

0 commit comments

Comments
 (0)