-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added reporting of code coverage by test suite.
Code coverage by the test suite is measured via pyTest and its pyTest-cov plug-in. The script `coverage.py` runs the coverage test, renders the coverage report, and also creates the coverage badge, unless that file already exists in the `tests` folder.
- Loading branch information
Showing
15 changed files
with
157 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
"""Measures code coverage by test suite.""" | ||
__license__ = 'MIT' | ||
|
||
|
||
from subprocess import run | ||
from pathlib import Path | ||
|
||
|
||
here = Path(__file__).resolve().parent | ||
root = here.parent | ||
file = here/'coverage.sqlite' | ||
|
||
run(['pytest', '--cov'], cwd=root) | ||
|
||
print('Rendering coverage report.') | ||
folder = (here/'coverage').relative_to(root) | ||
run(['coverage', 'html', f'--directory={folder}'], cwd=root) | ||
|
||
badge = root/'tests'/file.with_suffix('.svg').name | ||
if badge.exists(): | ||
print('Coverage badge already exists.') | ||
else: | ||
print('Rendering coverage badge.') | ||
run(['coverage-badge', '-f', '-o', str(badge)], cwd=root) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Steps to take when releasing a new version: | ||
* Bump version number and enter current date in `__init__.py`. | ||
* Add a dedicated commit for the version bump. | ||
* Tag the commit with the version number, for example: `git tag -a v1.0.3`. | ||
* Enter the release notes as an annotation. | ||
* Push the commit (but not the tag): `git push origin main`. | ||
* Check that documentation built successfully on Read-the-Docs. | ||
* Publish on PyPI by running `deploy/publish.py`. | ||
* Check that meta information is correct on PyPI. | ||
* Then push the tag: `git push --tags`. | ||
* Create a new release on GitHub and add the release notes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
"""Renders the documentation.""" | ||
__license__ = 'MIT' | ||
|
||
from subprocess import run | ||
from pathlib import Path | ||
|
||
root = Path(__file__).resolve().parent.parent | ||
process = run(['sphinx-build', 'docs', 'deploy/docs'], cwd=root) | ||
if process.returncode: | ||
raise RuntimeError('Error while rendering documentation.') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters