Skip to content

Commit 14b7098

Browse files
authored
Merge pull request #219 from derek73/ci/codecov-coverage
Add Codecov coverage reporting and README badges
2 parents ac46732 + a61200e commit 14b7098

4 files changed

Lines changed: 135 additions & 2 deletions

File tree

.github/workflows/python-package.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,16 @@ jobs:
4040
run: uv run mypy
4141
- name: Run Tests
4242
run: |
43-
uv run pytest
43+
uv run pytest --cov=nameparser --cov-report=xml
4444
uv run --with build python -m build --sdist
4545
uv run --with twine twine check dist/*
4646
uv run sphinx-build -b html docs dist/docs
4747
uv run sphinx-build -b doctest docs dist/doctest
4848
uv run python -m doctest README.rst
49+
- name: Upload coverage to Codecov
50+
if: matrix.python-version == '3.13'
51+
uses: codecov/codecov-action@v5
52+
with:
53+
token: ${{ secrets.CODECOV_TOKEN }}
54+
files: ./coverage.xml
55+
fail_ci_if_error: false

README.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Name Parser
22
===========
33

4-
|Build Status| |PyPI| |PyPI version| |Documentation|
4+
|Build Status| |PyPI| |PyPI version| |Documentation| |License| |Downloads| |Codecov|
55

66
A simple Python (3.10+) module for parsing human names into their
77
individual components.
@@ -150,3 +150,9 @@ https://github.com/derek73/python-nameparser
150150
:target: http://nameparser.readthedocs.io/en/latest/?badge=latest
151151
.. |PyPI version| image:: https://img.shields.io/pypi/pyversions/nameparser.svg
152152
:target: https://pypi.org/project/nameparser/
153+
.. |License| image:: https://img.shields.io/pypi/l/nameparser.svg
154+
:target: https://pypi.org/project/nameparser/
155+
.. |Downloads| image:: https://static.pepy.tech/badge/nameparser
156+
:target: https://pepy.tech/project/nameparser
157+
.. |Codecov| image:: https://codecov.io/gh/derek73/python-nameparser/branch/master/graph/badge.svg
158+
:target: https://codecov.io/gh/derek73/python-nameparser

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ dev = [
4545
"mypy (>=2.1)",
4646
"ruff (>=0.15)",
4747
"pytest-timeout>=2.4.0",
48+
"pytest-cov>=6",
4849
]
4950

5051
[tool.mypy]

0 commit comments

Comments
 (0)