setup.py - use extras_require for flask

Adding `moto` to the requirements file for my Django project pulls in `flask`, even though I don't need the server component. By making the `server` 'extra' then there is no hard requirement on flask.
This commit is contained in:
Adam Chainz 2016-09-26 13:44:05 +01:00
commit e6bf5550ce
2 changed files with 13 additions and 4 deletions

View file

@ -200,16 +200,24 @@ In general, Moto doesn't rely on anything specific to Boto. It only mocks AWS en
## Stand-alone Server Mode
Moto also comes with a stand-alone server mode. This allows you to utilize the backend structure of Moto even if you don't use Python.
Moto also has a stand-alone server mode. This allows you to utilize
the backend structure of Moto even if you don't use Python.
To run a service:
It uses flask, which isn't a default dependency. You can install the
server 'extra' package with:
```python
pip install moto[server]
```
You can then start it running a service:
```console
$ moto_server ec2
* Running on http://127.0.0.1:5000/
```
You can also pass the port as the second argument:
You can also pass the port:
```console
$ moto_server ec2 -p3000