Tianshou/CONTRIBUTING.md

45 lines
1.3 KiB
Markdown
Raw Normal View History

2020-03-27 16:24:07 +08:00
# 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
2020-04-02 21:57:26 +08:00
```bash
2020-03-27 16:24:07 +08:00
pytest test --cov tianshou -s
```
2020-04-02 21:57:26 +08:00
To run on your own GitHub Repo, enable the [GitHub Action](https://github.com/features/actions) and it will automatically run the test.
2020-04-02 12:31:22 +08:00
2020-03-27 16:24:07 +08:00
##### PEP8 Code Style Check
We follow PEP8 python code style. To check, in the main directory, run:
```python
2020-03-28 13:27:01 +08:00
flake8 . --count --show-source --statistics
2020-03-27 16:24:07 +08:00
```
#### 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.
2020-03-29 15:18:33 +08:00
To compile docs into webpages, run
2020-03-27 16:24:07 +08:00
```
make html
```
under the `docs/` directory. The generated webpages are in `docs/_build` and
2020-03-28 13:27:01 +08:00
can be viewed with browsers.