Skip to content

Commit 16d98db

Browse files
committed
Replace pytest-cov with coverage
1 parent 58ff93f commit 16d98db

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Template for open-source Python projects
22

3-
![](https://img.shields.io/badge/python-3.7%20%7C%203.8%20%7C%203.9%20%7C%203.10%20%7C%203.11-blue)
3+
![Python versions](https://img.shields.io/badge/python-3.7%20%7C%203.8%20%7C%203.9%20%7C%203.10%20%7C%203.11-blue)
44
![Tests](https://github.com/marvinfriede/python-project/actions/workflows/test.yml/badge.svg)
55
[![codecov](https://codecov.io/gh/marvinfriede/python-project/branch/master/graph/badge.svg?token=UEKDZY459S)](https://codecov.io/gh/marvinfriede/python-project)
66
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/marvinfriede/python-project/master.svg)](https://results.pre-commit.ci/latest/github/marvinfriede/python-project/master)
@@ -12,6 +12,7 @@ This repository aims to provide a starting template for Python projects containi
1212
I tried to incorporate most "best practices" but in the end, most of the design choices and tools are just personal preferences.
1313

1414
The following tools are used: black, codecov, pre-commit, pylint, pytest, pytest-cov, tox
15+
1516
<br>
1617

1718
## Source code
@@ -34,8 +35,8 @@ The [conftest.py](test/conftest.py) file is sort of a setup file that can be use
3435
([small example](https://github.com/tbmalt/tbmalt/blob/main/tests/conftest.py)) and setup code (fixtures) for all tests.
3536

3637
The test environment for pytest is setup with the `setup.cfg` and/or `pyproject.toml` file. `tox` needs extra configuration
37-
which can be found in the *deps* section of [tox.ini](tox.ini). Some projects also use a `requirements-tests.txt` file that lists
38-
all test dependencies and is also given in the *deps* section with `deps = -rrequirements-tests.txt`.
38+
which can be found in the _deps_ section of [tox.ini](tox.ini). Some projects also use a `requirements-tests.txt` file that lists
39+
all test dependencies and is also given in the _deps_ section with `deps = -rrequirements-tests.txt`.
3940
Furthermore, to run pytest from tox, the `commands` section must be given. Here, additional options for the code coverage report
4041
from the `coverage` tool are given.
4142

@@ -49,7 +50,8 @@ test module. Before committing, however, it is a good idea to check if your code
4950
time. Certain environments can be selected with `tox -e py37`. Note that `tox` must be able to find a Python interpreter for
5051
each version given in the envlist.
5152

52-
<details><summary>How to provide the Python interpreters for tox.</summary>
53+
<details>
54+
<summary>How to provide the Python interpreters for tox.</summary>
5355

5456
Unfortunately, this does not directly work with something like a conda environment but you can setup the environments and provide
5557
a symlink to a directory which is in your path.
@@ -125,3 +127,6 @@ The package can be installed with `pip install .` or something like `pip install
125127

126128
[pre-commit.ci](https://github.com/apps/pre-commit-ci/)
127129
[codecov](https://github.com/apps/codecov/)
130+
131+
[gitignore](https://www.toptal.com/developers/gitignore)
132+
[choose-a-license](https://choosealicense.com/)

environment.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1+
# conda env create -f environment.yaml
12
name: squarer
23
channels:
34
- defaults
45
- conda-forge
56
dependencies:
67
- black
8+
- coverage
79
- numpy
810
- pre-commit
911
- pylint
1012
- pytest
11-
- pytest-cov
1213
- tox
14+
- pip:
15+
- covdefaults

0 commit comments

Comments
 (0)