Skip to content

Commit

Permalink
Adjust coverage coveralls to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
pitbulk committed Jun 23, 2024
1 parent 89586c3 commit 14a42d4
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 33 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ jobs:
run: make pytest
lint:
runs-on: ubuntu-22.04
environment: CI
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand All @@ -71,11 +70,33 @@ jobs:
run: |
make flake8
make black
coveralls:
runs-on: ubuntu-22.04
environment: CI
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
pip install -U setuptools
sudo apt-get update -qq
sudo apt-get install -qq swig libxml2-dev libxmlsec1-dev
pip install --force-reinstall --no-binary lxml lxml
make install-req
make install-test
- name: Run coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
pip install coveralls
coverage run setup.py test
coverage run -m pytest
coverage report -m
coveralls
29 changes: 28 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Changelog = "https://github.com/SAML-Toolkits/python3-saml/blob/master/changelog

[project.optional-dependencies]
test = [
"coverage>=4.5.2",
"coverage[toml]>=4.5.2",
"pytest>=4.6",
]
lint = [
Expand Down Expand Up @@ -93,3 +93,30 @@ atomic = true
ignore_comments = true
skip_gitignore = true
src_paths = ['src']

[tool.coverage.run]
branch = true

[tool.coverage.paths]
source = [
"src/onelogin/saml2"
]

[tool.coverage.report]
# Regexes for lines to exclude from consideration
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug",
"if debug",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:"
]
show_missing = true
ignore_errors = true


[tool.coverage.html]
directory = "coverage_html_report"
30 changes: 0 additions & 30 deletions tests/coverage.rc

This file was deleted.

0 comments on commit 14a42d4

Please sign in to comment.