summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--python-coverage-threshold.spec334
-rw-r--r--sources1
3 files changed, 336 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..22e097f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/coverage_threshold-0.4.4.tar.gz
diff --git a/python-coverage-threshold.spec b/python-coverage-threshold.spec
new file mode 100644
index 0000000..b81c839
--- /dev/null
+++ b/python-coverage-threshold.spec
@@ -0,0 +1,334 @@
+%global _empty_manifest_terminate_build 0
+Name: python-coverage-threshold
+Version: 0.4.4
+Release: 1
+Summary: Tools for coverage threshold limits
+License: MIT License
+URL: https://github.com/DeanWay/coverage-threshold
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/9a/c3/98f30064ad7e50847d4502a82718446919b4277c51c499592d2b4e49fe79/coverage_threshold-0.4.4.tar.gz
+BuildArch: noarch
+
+Requires: python3-toml
+
+%description
+# coverage threshold
+
+A command line tool for checking coverage reports against configurable coverage minimums.
+Currently built for use around python's [coverage](https://pypi.org/project/coverage/)
+
+
+### Installation
+`pip install coverage-threshold`
+
+also recommended:
+
+`pip install coverage`
+
+### Usage
+Typical execution:
+```bash
+coverage run -m pytest tests/ # or any test runner here
+coverage json
+coverage-threshold
+```
+
+cli command options:
+
+```
+> coverage-threshold --help
+usage: coverage-threshold [-h] [--line-coverage-min LINE_COVERAGE_MIN]
+ [--branch-coverage-min BRANCH_COVERAGE_MIN]
+ [--combined-coverage-min COMBINED_COVERAGE_MIN]
+ [--file-line-coverage-min FILE_LINE_COVERAGE_MIN]
+ [--file-branch-coverage-min FILE_BRANCH_COVERAGE_MIN]
+ [--file-combined-coverage-min FILE_COMBINED_COVERAGE_MIN]
+ [--coverage-json COVERAGE_JSON] [--config CONFIG]
+
+A command line tool for checking coverage reports against configurable coverage minimums
+
+optional arguments:
+ -h, --help show this help message and exit
+ --line-coverage-min LINE_COVERAGE_MIN
+ minimum global average line coverage threshold
+ --branch-coverage-min BRANCH_COVERAGE_MIN
+ minimum global average branch coverage threshold
+ --combined-coverage-min COMBINED_COVERAGE_MIN
+ minimum global average combined line and branch coverage threshold
+ --file-line-coverage-min FILE_LINE_COVERAGE_MIN
+ the line coverage threshold for each file
+ --file-branch-coverage-min FILE_BRANCH_COVERAGE_MIN
+ the branch coverage threshold for each file
+ --file-combined-coverage-min FILE_COMBINED_COVERAGE_MIN
+ the combined line and branch coverage threshold for each file
+ --coverage-json COVERAGE_JSON
+ path to coverage json (default: ./coverage.json)
+ --config CONFIG path to config file (default: ./pyproject.toml)
+```
+
+
+### Config
+
+the current expected config file format is [toml](https://toml.io/en/)
+the default config file used is `pyproject.toml` but and alternative path can be specified with `--config`
+
+example config:
+```toml
+[coverage-threshold]
+line_coverage_min = 95
+file_line_coverage_min = 95
+branch_coverage_min = 50
+
+ [coverage-threshold.modules."src/cli/"]
+ file_line_coverage_min = 40
+
+ [coverage-threshold.modules."src/cli/my_command.py"]
+ file_line_coverage_min = 100
+
+ [coverage-threshold.modules."src/lib/"]
+ file_line_coverage_min = 100
+ file_branch_coverage_min = 100
+
+ [coverage-threshold.modules."src/model/"]
+ file_line_coverage_min = 100
+
+ [coverage-threshold.modules."src/__main__.py"]
+ file_line_coverage_min = 0
+```
+
+Each string key in `config.modules` is treated as a path prefix, where the longest matching prefix is used to configure the coverage thresholds for each file
+
+
+
+
+%package -n python3-coverage-threshold
+Summary: Tools for coverage threshold limits
+Provides: python-coverage-threshold
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-coverage-threshold
+# coverage threshold
+
+A command line tool for checking coverage reports against configurable coverage minimums.
+Currently built for use around python's [coverage](https://pypi.org/project/coverage/)
+
+
+### Installation
+`pip install coverage-threshold`
+
+also recommended:
+
+`pip install coverage`
+
+### Usage
+Typical execution:
+```bash
+coverage run -m pytest tests/ # or any test runner here
+coverage json
+coverage-threshold
+```
+
+cli command options:
+
+```
+> coverage-threshold --help
+usage: coverage-threshold [-h] [--line-coverage-min LINE_COVERAGE_MIN]
+ [--branch-coverage-min BRANCH_COVERAGE_MIN]
+ [--combined-coverage-min COMBINED_COVERAGE_MIN]
+ [--file-line-coverage-min FILE_LINE_COVERAGE_MIN]
+ [--file-branch-coverage-min FILE_BRANCH_COVERAGE_MIN]
+ [--file-combined-coverage-min FILE_COMBINED_COVERAGE_MIN]
+ [--coverage-json COVERAGE_JSON] [--config CONFIG]
+
+A command line tool for checking coverage reports against configurable coverage minimums
+
+optional arguments:
+ -h, --help show this help message and exit
+ --line-coverage-min LINE_COVERAGE_MIN
+ minimum global average line coverage threshold
+ --branch-coverage-min BRANCH_COVERAGE_MIN
+ minimum global average branch coverage threshold
+ --combined-coverage-min COMBINED_COVERAGE_MIN
+ minimum global average combined line and branch coverage threshold
+ --file-line-coverage-min FILE_LINE_COVERAGE_MIN
+ the line coverage threshold for each file
+ --file-branch-coverage-min FILE_BRANCH_COVERAGE_MIN
+ the branch coverage threshold for each file
+ --file-combined-coverage-min FILE_COMBINED_COVERAGE_MIN
+ the combined line and branch coverage threshold for each file
+ --coverage-json COVERAGE_JSON
+ path to coverage json (default: ./coverage.json)
+ --config CONFIG path to config file (default: ./pyproject.toml)
+```
+
+
+### Config
+
+the current expected config file format is [toml](https://toml.io/en/)
+the default config file used is `pyproject.toml` but and alternative path can be specified with `--config`
+
+example config:
+```toml
+[coverage-threshold]
+line_coverage_min = 95
+file_line_coverage_min = 95
+branch_coverage_min = 50
+
+ [coverage-threshold.modules."src/cli/"]
+ file_line_coverage_min = 40
+
+ [coverage-threshold.modules."src/cli/my_command.py"]
+ file_line_coverage_min = 100
+
+ [coverage-threshold.modules."src/lib/"]
+ file_line_coverage_min = 100
+ file_branch_coverage_min = 100
+
+ [coverage-threshold.modules."src/model/"]
+ file_line_coverage_min = 100
+
+ [coverage-threshold.modules."src/__main__.py"]
+ file_line_coverage_min = 0
+```
+
+Each string key in `config.modules` is treated as a path prefix, where the longest matching prefix is used to configure the coverage thresholds for each file
+
+
+
+
+%package help
+Summary: Development documents and examples for coverage-threshold
+Provides: python3-coverage-threshold-doc
+%description help
+# coverage threshold
+
+A command line tool for checking coverage reports against configurable coverage minimums.
+Currently built for use around python's [coverage](https://pypi.org/project/coverage/)
+
+
+### Installation
+`pip install coverage-threshold`
+
+also recommended:
+
+`pip install coverage`
+
+### Usage
+Typical execution:
+```bash
+coverage run -m pytest tests/ # or any test runner here
+coverage json
+coverage-threshold
+```
+
+cli command options:
+
+```
+> coverage-threshold --help
+usage: coverage-threshold [-h] [--line-coverage-min LINE_COVERAGE_MIN]
+ [--branch-coverage-min BRANCH_COVERAGE_MIN]
+ [--combined-coverage-min COMBINED_COVERAGE_MIN]
+ [--file-line-coverage-min FILE_LINE_COVERAGE_MIN]
+ [--file-branch-coverage-min FILE_BRANCH_COVERAGE_MIN]
+ [--file-combined-coverage-min FILE_COMBINED_COVERAGE_MIN]
+ [--coverage-json COVERAGE_JSON] [--config CONFIG]
+
+A command line tool for checking coverage reports against configurable coverage minimums
+
+optional arguments:
+ -h, --help show this help message and exit
+ --line-coverage-min LINE_COVERAGE_MIN
+ minimum global average line coverage threshold
+ --branch-coverage-min BRANCH_COVERAGE_MIN
+ minimum global average branch coverage threshold
+ --combined-coverage-min COMBINED_COVERAGE_MIN
+ minimum global average combined line and branch coverage threshold
+ --file-line-coverage-min FILE_LINE_COVERAGE_MIN
+ the line coverage threshold for each file
+ --file-branch-coverage-min FILE_BRANCH_COVERAGE_MIN
+ the branch coverage threshold for each file
+ --file-combined-coverage-min FILE_COMBINED_COVERAGE_MIN
+ the combined line and branch coverage threshold for each file
+ --coverage-json COVERAGE_JSON
+ path to coverage json (default: ./coverage.json)
+ --config CONFIG path to config file (default: ./pyproject.toml)
+```
+
+
+### Config
+
+the current expected config file format is [toml](https://toml.io/en/)
+the default config file used is `pyproject.toml` but and alternative path can be specified with `--config`
+
+example config:
+```toml
+[coverage-threshold]
+line_coverage_min = 95
+file_line_coverage_min = 95
+branch_coverage_min = 50
+
+ [coverage-threshold.modules."src/cli/"]
+ file_line_coverage_min = 40
+
+ [coverage-threshold.modules."src/cli/my_command.py"]
+ file_line_coverage_min = 100
+
+ [coverage-threshold.modules."src/lib/"]
+ file_line_coverage_min = 100
+ file_branch_coverage_min = 100
+
+ [coverage-threshold.modules."src/model/"]
+ file_line_coverage_min = 100
+
+ [coverage-threshold.modules."src/__main__.py"]
+ file_line_coverage_min = 0
+```
+
+Each string key in `config.modules` is treated as a path prefix, where the longest matching prefix is used to configure the coverage thresholds for each file
+
+
+
+
+%prep
+%autosetup -n coverage-threshold-0.4.4
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-coverage-threshold -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Wed May 31 2023 Python_Bot <Python_Bot@openeuler.org> - 0.4.4-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..d86320c
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+9b86201eb2b66da078932a790fc7b541 coverage_threshold-0.4.4.tar.gz