Tianshou/CONTRIBUTING.md
2020-03-27 16:24:07 +08:00

43 lines
1.2 KiB
Markdown

# Contributing
To install Tianshou in an "editable" mode, run
```bash
pip install -e .
```
in the main directory. This installation is removable by
```bash
python setup.py develop --uninstall
```
Additional dependencies for developments can be installed by
```bash
pip install ".[dev]"
```
#### Tests
This command will run automatic tests in the main directory
```python
pytest test --cov tianshou -s
```
##### PEP8 Code Style Check
We follow PEP8 python code style. To check, in the main directory, run:
```python
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=30 --max-line-length=79 --statistics
```
#### Documents
Documents are written under the `docs/` directory as RestructuredText (`.rst`) files. `index.rst` is the main page. A Tutorial on RestructuredText can be found [here](https://pythonhosted.org/an_example_pypi_project/sphinx.html).
API References are automatically generated by [Sphinx](http://www.sphinx-doc.org/en/stable/) according to the outlines under
`doc/api/` and should be modified when any code changes.
To compile docs into webpages, Run
```
make html
```
under the `docs/` directory. The generated webpages are in `docs/_build` and
can be viewed with browsers.