Blob Blame History Raw
Name:           python-diff-cover
Version:        0.9.9
Release:        1%{?dist}
Summary:        Automatically find diff lines that need test coverage

License:        ASL 2.0
URL:            https://github.com/edx/diff-cover/
Source0:        https://pypi.python.org/packages/source/d/diff_cover/diff_cover-%{version}.tar.gz

BuildArch:      noarch

# needed to generate the man page
BuildRequires:  help2man

%description
Diff coverage is the percentage of new or modified lines that are covered by
tests.  This provides a clear and achievable standard for code review: If you
touch a line of code, that line should be covered.  Code coverage is *every*
developer's responsibility!

The diff-cover command line tool compares an XML coverage report with the
output of git diff.  It then reports coverage information for lines in the
diff.

%package -n python2-diff-cover
Summary:        Automatically find diff lines that need test coverage in Python 2
%{?python_provide:%python_provide python2-diff-cover}

BuildRequires:  python2-devel
BuildRequires:  python-setuptools

# from requirements.txt, checked by setuptools when running entry point scripts
Requires:       python-jinja2 >= 2.7.1
Requires:       python-six >= 1.6.1
Requires:       python-pygments >= 2.0.1
Requires:       python-jinja2_pluralize

# needed for the _git_root test
Requires:       git

%description -n python2-diff-cover
Diff coverage is the percentage of new or modified lines that are covered by
tests.  This provides a clear and achievable standard for code review: If you
touch a line of code, that line should be covered.  Code coverage is *every*
developer's responsibility!

The diff-cover command line tool compares an XML coverage report with the
output of git diff.  It then reports coverage information for lines in the
diff.

%package -n python3-diff-cover
Summary:        Automatically find diff lines that need test coverage in Python 3
%{?python_provide:%python_provide python3-diff-cover}

BuildRequires:  python3-devel
BuildRequires:  python3-setuptools

# Required for the entry_point scripts
Requires:       python3-setuptools

# from requirements.txt
Requires:       python3-jinja2 >= 2.7.1
Requires:       python3-six >= 1.6.1
Requires:       python3-pygments >= 2.0.1
Requires:       python3-jinja2_pluralize

# needed for the _git_root test
Requires:       git

# Copy the python3 requires to BuildRequires so we can run the entry point
# scripts for help2man
BuildRequires:  python3-jinja2 >= 2.7.1
BuildRequires:  python3-six >= 1.6.1
BuildRequires:  python3-pygments >= 2.0.1
BuildRequires:  python3-jinja2_pluralize
BuildRequires:  git

%description -n python3-diff-cover
Diff coverage is the percentage of new or modified lines that are covered by
tests.  This provides a clear and achievable standard for code review: If you
touch a line of code, that line should be covered.  Code coverage is *every*
developer's responsibility!

The diff-cover command line tool compares an XML coverage report with the
output of git diff.  It then reports coverage information for lines in the
diff.

%prep
%autosetup -n diff_cover-%{version}
rm -rf diff_cover.egg-info

%build
%py2_build
%py3_build

%install
# Run the python3 install last so that it will overwrite the entry-point
# scripts in /usr/bin
%py2_install
%py3_install

mkdir -p %{buildroot}%{_mandir}/man1
PYTHONPATH=%{buildroot}%{python3_sitelib} \
    help2man --no-info --version-string 'diff-cover %{version}' \
        -o %{buildroot}%{_mandir}/man1/diff-cover.1 \
        %{buildroot}%{_bindir}/diff-cover

PYTHONPATH=%{buildroot}%{python3_sitelib} \
    help2man --no-info --version-string 'diff-quality %{version}' \
        -o %{buildroot}%{_mandir}/man1/diff-quality.1 \
        %{buildroot}%{_bindir}/diff-quality

%files -n python2-diff-cover
%license LICENSE
%doc AUTHORS README.rst
%{python2_sitelib}/diff_cover
%{python2_sitelib}/diff_cover-%{version}-*.egg-info

%files -n python3-diff-cover
%license LICENSE
%doc AUTHORS README.rst
%{_bindir}/diff-cover
%{_bindir}/diff-quality
%{_mandir}/man1/diff-cover.1*
%{_mandir}/man1/diff-quality.1*
%{python3_sitelib}/diff_cover
%{python3_sitelib}/diff_cover-%{version}-*.egg-info

%changelog
* Tue Aug 16 2016 David Shea <dshea@redhat.com> - 0.9.9-1
- Fix bug where only one file was being checked in diff-quality
- Fix bug where diff-quality would attempt to read deleted files

* Thu Jul 28 2016 David Shea <dshea@redhat.com> 0.9.8-1
- Fixes to ESLINT to work with 2.13

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.7-2
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Mon Apr  4 2016 David Shea <dshea@redhat.com> 0.9.7-1
- Update to 0.9.7, which moves logging configuration from __main__() to main()

* Mon Feb 22 2016 David Shea <dshea@redhat.com> 0.9.6-1
- Update to 0.9.6, which changes the following:
- Move logging configuration to main for better integrations with people importing the tool.
- Fix git-diff with `mnemonicprefix` option
- Now check for tool existence by trying to run the tool rather than trying to import it.

* Mon Feb 15 2016 David Shea <dshea@redhat.com> 0.9.3-1
- Remove %%check since it's become too much of a pain and upstream runs tests anyway
- Update to 0.9.3, which changes the following:
- Add support for specifying an external css file
- Add ESLint driver
- Significant reworking of diff-quality to simplify the addition of drivers

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Mon Dec 21 2015 David Shea <dshea@redhat.com> - 0.8.6-1
- Fix handling source paths that contain spaces

* Tue Dec  1 2015 David Shea <dshea@redhat.com> - 0.8.5-1
- Fix diff-cover when color.ui=always is set in git
- Drop python-lazy to support Python 3.5

* Mon Nov 16 2015 David Shea <dshea@redhat.com> - 0.8.3-3
- Rebuild with python 3.5 dependencies in place

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org>
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Mon Nov  2 2015 David Shea <dshea@redhat.com> - 0.8.3-1
- Fix diff-quality when installed under a folder containing 'diff-cover'

* Fri Sep 18 2015 David Shea <dshea@redhat.com> - 0.8.2-1
- Fix handling of windows paths in cobertura files

* Mon Sep 14 2015 David Shea <dshea@redhat.com> - 0.8.1-1
- Update to diff_cover-0.8.1 which does not change anything significant in Linux
- Switch to the new packaging guidelines, which renames python-diff-cover to python2-diff-cover
- Fix the dependencies for the python3 /usr/bin script.

* Wed Aug 26 2015 David Shea <dshea@redhat.com> - 0.8.0-1
- Move the /usr/bin scripts to the python3 package.
- Update to upstream 0.8.0 with the following changes:
- Added pylint support
- Fixed bug around python 1.6 and pyflakes
- Update Pygments to 2.0.1
- Fixed bug in pylint support around duplciate code issues
- Added ability to ignore unstaged changes Thanks DanCardin
- License change to ASL 2.0
- PyPy Support now verified in tests
- Fix for python 2.6 support
- Ensure all sources are captured when dealing with non python cobertura files.
- Suppress error output on tests when that output is expected
- Adds posargs to allow you to configure test runs more easily.
- Add support for some additional Flake8 lugins
- Fix readme syntax so diff-cover looks prettier on pypy.
- Add JSHint to diff-quality.

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Wed Jan 28 2015 David Shea <dshea@redhat.com> - 0.7.2-2
- Use %license for the license file

* Fri Nov  7 2014 David Shea <dshea@redhat.com> - 0.7.2-1
- bugfix around prasing of options
- enable nosetests in spec file

* Wed Oct 22 2014 David Shea <dshea@redhat.com> - 0.7.1-1
- Incorporate sources tag in corbetura reports improving diff-cover's behavior in non python codebases
- Generating HTML report still allows STDOUT to print the regular report

* Mon Oct 13 2014 David Shea <dshea@redhat.com> - 0.6.2-1
- Added log line for when diff-cover fails due to coverage being lower than the fail-under condition

* Sun Oct  5 2014 David Shea <dshea@redhat.com> - 0.6.1-1
- Fixed issue where error message was not being returned after diff-quality errors
- Fixed issue where diff-quality would fail due to warnings.

* Fri Aug  1 2014 David Shea <dshea@redhat.com> - 0.6.0-1
- Add --fail-under option
- Fix requires in spec file for python3 package

* Mon Jul 21 2014 David Shea <dshea@redhat.com> - 0.5.7-2
- Actually remove lxml from requires and buildrequires

* Tue Jul 15 2014 David Shea <dshea@redhat.com> - 0.5.7-1
- Diff quality no longer requires every potential quality tool to be installed
- Fix bug where logging was being called without being configured
- Remove lxml requirement speeding up builds by roughly 50%
- Fixed the git requirement

* Tue Jul  8 2014 David Shea <dshea@redaht.com> - 0.5.4-1
- Fix bug when writing report to stdout. Ensure that all file like objects that get passed into the report generator take bytes
- Run diff cover over the code in each language
- Pluralize report output
- Bugfixes around git_path and unicode
- Add snippets to quality html reports
- Fix snippets relative path
- Add support for Pyflakes

* Mon Jun 16 2014 David Shea <dshea@redhat.com> - 0.4.3-1
- Remove dependency on ipython

* Wed Jun 11 2014 David Shea <dshea@redhat.com> - 0.4.2-1
- Use context manager for output_file
- Write report to stdout even with --html-report
- Load python sources in a safer way

* Mon Jun  2 2014 David Shea <dshea@redhat.com> - 0.4.1-1
- New upstream release diff-cover-0.4.1

* Fri May  2 2014 David Shea <dshea@redhat.com> - 0.4.0-1
- New upstream release diff-cover-0.4.0

* Fri Mar 21 2014 David Shea <dshea@redhat.com> - 0.2.9-1
- Initial package