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: README.md
+13-5Lines changed: 13 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@ This repository aims to provide a starting template for Python projects containi
11
11
12
12
I tried to incorporate most "best practices" but in the end, most of the design choices and tools are just personal preferences.
13
13
14
+
The following tools are used: black, codecov, pre-commit, pylint, pytest, pytest-cov, tox
14
15
<br>
15
16
16
17
## Source code
@@ -42,8 +43,8 @@ _When to use pytest, coverage and tox?_
42
43
43
44
Personally, I mostly use just pytest without coverage to test in my working environment with `pytest -svv test` or a specific
44
45
test module. Before committing, however, it is a good idea to check if your code also runs in different environments, which is where
45
-
tox comes in. Running just `tox`, will test in all environments specified in [tox.ini](tox.ini)'s envlist and may take some
46
-
time. Certain environments can be selected with `tox -e py37`. Note that tox must be able to find a Python interpreter for
46
+
`tox` comes in. Running just `tox`, will test in all environments specified in [tox.ini](tox.ini)'s envlist and may take some
47
+
time. Certain environments can be selected with `tox -e py37`. Note that `tox` must be able to find a Python interpreter for
47
48
each version given in the envlist.
48
49
49
50
<details><summary>How to provide the Python interpreters for tox.</summary>
@@ -73,7 +74,12 @@ Finally, some handy features of pytest you should be aware of:
73
74
74
75
Packaging is done with [`setuptools`](https://setuptools.pypa.io/en/latest/index.html), which is configured through the `pyproject.toml` and/or `setup.cfg`/`setup.py` files.
75
76
76
-
<details><summary>`pyproject.toml` vs. `setup.cfg` vs `setup.py`</summary>
77
+
<details>
78
+
<summary>
79
+
<code>pyproject.toml</code> vs.
80
+
<code>setup.cfg</code> vs
81
+
<code>setup.py</code>
82
+
</summary>
77
83
78
84
The `setup.py` file is a Python script and configuration is passed through keyword arguments of `setuptools.setup()`. This is not recommended due to possible security and parsing issues. The same setup can be accomplished in a declarative style within `setup.cfg` and `setup.py` remains mostly empty only calling `setuptools.setup()`.
79
85
The `pyproject.toml` file aims to unify configuration files including various tools like black or pytest. For packaging, it is very similar to `setup.cfg`. However, `pyproject.toml` has not been adopted as the default yet and many projects still use `setup.cfg` to declare the packaging setup. Note that `setup.py` is not necessary if a `pyproject.toml` is present.
@@ -87,7 +93,7 @@ The `pyproject.toml` file aims to unify configuration files including various to
0 commit comments