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: docs/contributing.rst
+26-21Lines changed: 26 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,14 +18,26 @@ in the main directory. This installation is removable by
18
18
$ python setup.py develop --uninstall
19
19
20
20
21
-
PEP8 Code Style Check
22
-
---------------------
21
+
PEP8 Code Style Check and Code Formatter
22
+
----------------------------------------
23
23
24
-
We follow PEP8 python code style. To check, in the main directory, run:
24
+
We follow PEP8 python code style with flake8. To check, in the main directory, run:
25
25
26
26
.. code-block:: bash
27
27
28
-
$ flake8 . --count --show-source --statistics
28
+
$ make lint
29
+
30
+
We use isort and yapf to format all codes. To format, in the main directory, run:
31
+
32
+
.. code-block:: bash
33
+
34
+
$ make format
35
+
36
+
To check if formatted correctly, in the main directory, run:
37
+
38
+
.. code-block:: bash
39
+
40
+
$ make check-codestyle
29
41
30
42
31
43
Type Check
@@ -35,7 +47,7 @@ We use `mypy <https://github.com/python/mypy/>`_ to check the type annotations.
35
47
36
48
.. code-block:: bash
37
49
38
-
$ mypy
50
+
$ make mypy
39
51
40
52
41
53
Test Locally
@@ -45,7 +57,7 @@ This command will run automatic tests in the main directory
45
57
46
58
.. code-block:: bash
47
59
48
-
$ pytest test --cov tianshou -s --durations 0 -v
60
+
$ make pytest
49
61
50
62
51
63
Test by GitHub Actions
@@ -76,13 +88,13 @@ Documentations are written under the ``docs/`` directory as ReStructuredText (``
76
88
77
89
API References are automatically generated by `Sphinx <http://www.sphinx-doc.org/en/stable/>`_ according to the outlines under ``docs/api/`` and should be modified when any code changes.
78
90
79
-
To compile documentation into webpages, run
91
+
To compile documentation into webpage, run
80
92
81
93
.. code-block:: bash
82
94
83
-
$ make html
95
+
$ make doc
84
96
85
-
under the ``docs/`` directory. The generated webpages are in ``docs/_build`` and can be viewed with browsers.
97
+
The generated webpage is in ``docs/_build`` and can be viewed with browser (http://0.0.0.0:8000/).
86
98
87
99
Chinese documentation is in https://tianshou.readthedocs.io/zh/latest/.
88
100
@@ -92,21 +104,14 @@ Documentation Generation Test
92
104
93
105
We have the following three documentation tests:
94
106
95
-
1. pydocstyle: test docstrings under ``tianshou/``. To check, in the main directory, run:
96
-
97
-
.. code-block:: bash
98
-
99
-
$ pydocstyle tianshou
100
-
101
-
2. doc8: test ReStructuredText formats. To check, in the main directory, run:
107
+
1. pydocstyle: test all docstring under ``tianshou/``;
102
108
103
-
.. code-block:: bash
109
+
2. doc8: test ReStructuredText format;
104
110
105
-
$ doc8 docs
111
+
3. sphinx test: test if there is any error/warning when generating front-end html documentation.
106
112
107
-
3. sphinx test: test if there is any errors/warnings when generating front-end html documentations. To check, in the main directory, run:
Copy file name to clipboardExpand all lines: docs/contributor.rst
-1Lines changed: 0 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,6 @@ Contributor
4
4
We always welcome contributions to help make Tianshou better. Below are an incomplete list of our contributors (find more on `this page <https://github.com/thu-ml/tianshou/graphs/contributors>`_).
0 commit comments