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
{{ message }}
This repository was archived by the owner on May 26, 2026. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+56-6Lines changed: 56 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,6 +73,7 @@ black makes sure the flake8 checks pass by autoformatting all the .py files.
73
73
Quotting the the [black documentation](https://black.readthedocs.io/en/stable/?badge=stable) directly:
74
74
*"Black makes code review faster by producing the smallest diffs possible. Blackened code looks the same regardless of the project you’re reading. Formatting becomes transparent after a while and you can focus on the content instead."*
75
75
76
+
Black is part of the requirements.dev.txt file and can be installed with pip.
76
77
To format a directory with black run the terminal command:
77
78
`black examplepackage` or file.py etc.
78
79
@@ -83,11 +84,24 @@ Some IDEs have format on save features and can be configured to use black:
83
84
84
85
## pydocstyle
85
86
[pydocstyle](http://www.pydocstyle.org/en/stable/) is a static analysis tool for checking compliance with Python docstring conventions.
86
-
By using pydocstyle we make sure that all modules and functions have consistent and good documentation.
87
+
By using pydocstyle we make sure that all modules and functions have consistent and good documentation.
88
+
89
+
pydocstyle is part of the requirements.dev.txt file and can be installed with pip.
90
+
To run a pydocstyle check you simply execute the terminal command:
91
+
`pydocstyle examplepackage`*or any other dir that contains python files*
92
+
93
+
You can configure pydocstyle by adding a section for it in the [setup.cfg](setup.cfg) file. For this template we're using the numpy documentation convention and we're choosing to ignore some specific standards (e.g. D400 - docstring should be in imperative mood)
87
94
88
95
## pytest
89
-
*[insert description]*
96
+
Quotting the the [pytest documentation](https://docs.pytest.org/en/6.2.x/index.html) directly:
97
+
*"The pytest framework makes it easy to write small tests, yet scales to support complex functional testing for applications and libraries."*
98
+
99
+
The tests for the package live in the [examplepackage/tests](examplepackage/tests) directory. Files in the main directory and its subdirectories that start with test_ and end with .py are recognised by pytest as test containing files (more rules for discovery [here](https://docs.pytest.org/en/6.2.x/goodpractices.html#conventions-for-python-test-discovery)).
90
100
101
+
pytest is part of the requirements.dev.txt file and can be installed with pip.
102
+
To run a pytest check you simply execute the terminal command:
103
+
`pytest examplepackage`*or any other dir that contains python files*
104
+
91
105
## Sphinx documentation
92
106
[Sphinx](https://www.sphinx-doc.org/en/master/) is a tool that makes it easy to create intelligent and beautiful documentation.
93
107
The [docs/](docs) diretory is where the configuration for sphinx lives. The dependencies for the docs are in [docs/requiremetns.txt](docs/requiremetns.txt).
@@ -110,10 +124,41 @@ The build directory that contains the html version of the docs is in the .gitign
110
124
Sphinx has many functionalities so for more details read the official documentation.
111
125
112
126
## setup.cfg
113
-
*[insert description]*
127
+
[setup.cfg](setup.cfg) has many roles, for this template we're using it to configure things like flake8 and pydocstyle.
`pip install -e .` or `pip install --editable .` installs the package in editable (development) mode.
@@ -125,8 +170,7 @@ Usefull links:
125
170
## .gitignore
126
171
The title is pretty self explanatory.
127
172
128
-
.gitignore is a file where you can add files and directories that you want git to ignore. The [.gitignore](.gitignore) in this template has the typical content.
129
-
e.g. .venv, the directory that contains the python virtual environment, should not be push to github and is in .gitignore.
173
+
.gitignore is a file where you can add files and directories that you want git to ignore. The [.gitignore](.gitignore) in this template has the typical content. For example .venv, the directory that contains the python virtual environment, should not be push to github and is in .gitignore.
130
174
131
175
## Github Actions
132
176
From the official https://github.com/features/actions page:
@@ -139,6 +183,12 @@ This runs the following actions for every pull-request and every push to merge:
139
183
3. build and test (with pytest) for all the combinations of the chosen operating systems and python versions.
140
184
e.g. macos-latest and python 3.7, 3.8
141
185
186
+
With this configuration, reviewers can instantly spot whether the code meets the minimum standards and passes the tests:
0 commit comments