Skip to content

Commit 2132645

Browse files
committed
Support for template-repo-python#104
1 parent 3abef8a commit 2132645

5 files changed

Lines changed: 43 additions & 15 deletions

File tree

.github/workflows/unstable-cicd.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ jobs:
7676
ossrh_password: ${{secrets.OSSRH_PASSWORD}}
7777
CODE_SIGNING_KEY: ${{secrets.CODE_SIGNING_KEY}}
7878
ADMIN_GITHUB_TOKEN: ${{secrets.ADMIN_GITHUB_TOKEN}}
79+
-
80+
name: 🛏️ Upload Coverage
81+
uses: SonarSource/sonarqube-scan-action@v5
82+
env:
83+
SONAR_TOKEN: ${{secrets.SONAR_TOKEN}}
7984

8085
...
8186

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ build/
8888
test-data/
8989
.venv
9090
*.egg-info
91+
.coverage
92+
coverage.xml
9193

9294
# Python virtual environment
9395
venv/

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ omit = */_version.py,*/__init__.py
124124
#
125125
# See https://docs.pytest.org/ for more information.
126126
[tool:pytest]
127-
addopts = -n auto --no-cov
127+
addopts = -n auto
128128

129129

130130
# Installation Options

sonar-project.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
sonar.projectKey=NASA-PDS_registry
2+
sonar.organization=nasa-pds
3+
sonar.python.coverage.reportPaths=coverage.xml

tox.ini

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,42 @@
11
[tox]
22
envlist = py313, docs, lint
3-
isolated_build = True
3+
requires = tox>=4.6
44

55
[testenv]
6-
deps = .[dev]
7-
whitelist_externals = pytest
8-
commands = pytest
6+
description = run tests
7+
basepython = python3.13
8+
package = wheel
9+
extras = dev
10+
usedevelop = true
11+
commands = pytest --cov=src --cov-report=xml {posargs}
912

1013
[testenv:docs]
11-
deps = .[dev]
12-
whitelist_externals = python
13-
commands = sphinx-build -b html docs/source docs/build/html
14+
description = build docs
15+
extras = dev
16+
commands = sphinx-build -b html docs/source docs/build
1417

1518
[testenv:lint]
16-
deps = pre-commit
17-
commands=
18-
python -m pre_commit run --color=always {posargs:--all}
19+
description = run linters
1920
skip_install = true
21+
deps = pre-commit
22+
commands = python -m pre_commit run --color=always {posargs:--all}
2023

21-
[testenv:dev]
22-
basepython = python3.13
23-
usedevelop = True
24-
deps = .[dev]
24+
[coverage:run]
25+
source = src
26+
omit =
27+
*/tests/*
28+
*/test_*
29+
*/__pycache__/*
30+
31+
[coverage:report]
32+
exclude_lines =
33+
pragma: no cover
34+
def __repr__
35+
if self.debug:
36+
if settings.DEBUG
37+
raise AssertionError
38+
raise NotImplementedError
39+
if 0:
40+
if __name__ == .__main__.:
41+
class .*\bProtocol\):
42+
@(abc\.)?abstractmethod

0 commit comments

Comments
 (0)