Skip to content

Commit 287a3f4

Browse files
committed
Adding code coverage
1 parent 036b7ea commit 287a3f4

6 files changed

Lines changed: 42 additions & 50 deletions

File tree

.github/workflows/build_pypi.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,18 @@ jobs:
5454
pip install virtualenv
5555
virtualenv venv
5656
. venv/bin/activate
57-
pip install build pytest dist/*.whl
57+
pip install build "coverage[toml]" pytest dist/*.whl
5858
- name: Perform unit tests
5959
run: |
6060
. venv/bin/activate
61-
python -m pytest tests/*.py --verbose
61+
python -m coverage run -m pytest tests/*.py --verbose
62+
python -m coverage report
63+
python -m coverage xml
64+
- name: Upload coverage report
65+
uses: codecov/codecov-action@v5
66+
with:
67+
files: coverage.xml
68+
fail_ci_if_error: false
6269

6370
upload_pypi:
6471
needs: [build-pip, test-pip]
@@ -73,4 +80,4 @@ jobs:
7380
name: whl
7481
path: dist
7582

76-
- uses: pypa/gh-action-pypi-publish@release/v1
83+
- uses: pypa/gh-action-pypi-publish@release/v1

COMPILATION.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# PyDFT
22

3-
[![build](https://github.com/ifilot/pydft/actions/workflows/build_pypi.yml/badge.svg)](https://github.com/ifilot/pydft/actions/workflows/build_pypi.yml)
4-
[![PyPI](https://img.shields.io/pypi/v/pydft?color=green)](https://pypi.org/project/pydft/)
5-
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
3+
[![build](https://github.com/ifilot/pydft/actions/workflows/build_pypi.yml/badge.svg)](https://github.com/ifilot/pydft/actions/workflows/build_pypi.yml)
4+
[![codecov](https://codecov.io/gh/ifilot/pydft/branch/master/graph/badge.svg)](https://codecov.io/gh/ifilot/pydft)
5+
[![PyPI](https://img.shields.io/pypi/v/pydft?color=green)](https://pypi.org/project/pydft/)
6+
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
67

78
> [!NOTE]
89
> Python based Density Functional Theory code for educational purposes. The

build.sh

Lines changed: 0 additions & 1 deletion
This file was deleted.

doc.Dockerfile

Lines changed: 0 additions & 2 deletions
This file was deleted.

pyproject.toml

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,36 @@ classifiers = [
1919
"Programming Language :: Python :: 3",
2020
"Operating System :: OS Independent",
2121
]
22-
dependencies = [
23-
"scipy>=1.15",
24-
"numpy",
25-
"pyqint>=1.2",
22+
dependencies = [
23+
"scipy>=1.15",
24+
"numpy",
25+
"pyqint>=1.2",
2626
"pylebedev",
2727
"matplotlib",
28-
"numba"
29-
]
30-
31-
[tool.setuptools]
32-
include-package-data = true
33-
34-
[tool.setuptools.packages.find]
35-
where = ["."]
36-
include = ["pydft*"]
28+
"numba"
29+
]
30+
31+
[project.optional-dependencies]
32+
test = [
33+
"coverage[toml]",
34+
"pytest",
35+
]
36+
37+
[tool.setuptools]
38+
include-package-data = true
39+
40+
[tool.setuptools.packages.find]
41+
where = ["."]
42+
include = ["pydft*"]
43+
44+
[tool.coverage.run]
45+
branch = true
46+
source = ["pydft"]
47+
48+
[tool.coverage.report]
49+
show_missing = true
50+
skip_covered = true
3751

3852
[project.urls]
3953
"Homepage" = "https://github.com/ifilot/pydft"
40-
"Bug Tracker" = "https://github.com/ifilot/pydft/issues"
54+
"Bug Tracker" = "https://github.com/ifilot/pydft/issues"

0 commit comments

Comments
 (0)