diff --git a/.gitignore b/.gitignore index 1ba1d05..6a946c9 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,3 @@ /diff_cover-0.6.2.tar.gz /diff_cover-0.7.1.tar.gz /diff_cover-0.7.2.tar.gz -/diff_cover-0.7.3.tar.gz diff --git a/python-diff-cover-0.2.9-noscripts3.patch b/python-diff-cover-0.2.9-noscripts3.patch new file mode 100644 index 0000000..c70e5ff --- /dev/null +++ b/python-diff-cover-0.2.9-noscripts3.patch @@ -0,0 +1,31 @@ +diff -purN diff_cover-0.2.9.orig/setup3.py diff_cover-0.2.9/setup3.py +--- diff_cover-0.2.9.orig/setup3.py 1969-12-31 19:00:00.000000000 -0500 ++++ diff_cover-0.2.9/setup3.py 2014-03-21 11:20:58.228016126 -0400 +@@ -0,0 +1,27 @@ ++#!/usr/bin/env python ++ ++from setuptools import setup ++from diff_cover import VERSION, DESCRIPTION ++ ++REQUIREMENTS = [line.strip() for line in ++ open("requirements.txt").readlines()] ++ ++setup( ++ name='diff_cover', ++ version=VERSION, ++ author='edX', ++ url='http://github.com/edx/diff-cover', ++ description=DESCRIPTION, ++ license='AGPL', ++ classifiers=['Development Status :: 3 - Alpha', ++ 'Environment :: Console', ++ 'Intended Audience :: Developers', ++ 'License :: OSI Approved :: GNU Affero General Public License v3', ++ 'Operating System :: OS Independent', ++ 'Programming Language :: Python', ++ 'Topic :: Software Development :: Testing', ++ 'Topic :: Software Development :: Quality Assurance'], ++ packages=['diff_cover'], ++ package_data={'diff_cover': ['templates/*.txt', 'templates/*.html']}, ++ install_requires=REQUIREMENTS ++) diff --git a/python-diff-cover.spec b/python-diff-cover.spec index c3e5bf9..3f82962 100644 --- a/python-diff-cover.spec +++ b/python-diff-cover.spec @@ -1,11 +1,12 @@ Name: python-diff-cover -Version: 0.7.3 +Version: 0.7.2 Release: 1%{?dist} Summary: Automatically find diff lines that need test coverage License: AGPLv3 URL: https://github.com/edx/diff-cover/ Source0: https://pypi.python.org/packages/source/d/diff_cover/diff_cover-%{version}.tar.gz +Patch0: python-diff-cover-0.2.9-noscripts3.patch BuildArch: noarch @@ -15,24 +16,19 @@ BuildRequires: python-setuptools # Required for the entry_point scripts Requires: python-setuptools -%define jinja2ver 2.7.1 -%define lazyver 1.1 -%define sixver 1.6.1 -%define pygmentsver 2.0.1 - # from requirements.txt, checked by setuptools when running entry point scripts -Requires: python-jinja2 >= %{jinja2ver} -Requires: python-lazy >= %{lazyver} -Requires: python-six >= %{sixver} -Requires: python-pygments >= %{pygmentsver} +Requires: python-jinja2 >= 2.7.1 +Requires: python-lazy >= 1.1 +Requires: python-six >= 1.6.1 +Requires: python-pygments == 1.6 Requires: python-jinja2_pluralize -# Copy the requires to BuildRequires so we can run the entry point +# Copy the python2 requires to BuildRequires so we can run the entry point # scripts for help2man -BuildRequires: python-jinja2 >= %{jinja2ver} -BuildRequires: python-lazy >= %{lazyver} -BuildRequires: python-six >= %{sixver} -BuildRequires: python-pygments >= %{pygmentsver} +BuildRequires: python-jinja2 >= 2.7.1 +BuildRequires: python-lazy >= 1.1 +BuildRequires: python-six >= 1.6.1 +BuildRequires: python-pygments == 1.6 BuildRequires: python-jinja2_pluralize # needed for the _git_root test @@ -67,20 +63,13 @@ Summary: Automatically find diff lines that need test coverage in Python BuildRequires: python3-devel BuildRequires: python3-setuptools -Requires: python3-jinja2 >= %{jinja2ver} -Requires: python3-lazy >= %{lazyver} -Requires: python3-six >= %{sixver} -Requires: python3-pygments >= %{pygmentsver} +Requires: python3-jinja2 >= 2.7.1 +Requires: python3-lazy >= 1.1 +Requires: python3-six >= 1.6.1 +Requires: python3-pygments >= 1.6 Requires: python3-jinja2_pluralize Requires: git -# More buildrequires for help2man -BuildRequires: python3-jinja2 >= %{jinja2ver} -BuildRequires: python3-lazy >= %{lazyver} -BuildRequires: python3-six >= %{sixver} -BuildRequires: python3-pygments >= %{pygmentsver} -BuildRequires: python3-jinja2_pluralize - %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 @@ -95,24 +84,23 @@ diff. %setup -q -n diff_cover-%{version} rm -rf diff_cover.egg-info +# Disable scripts for the python3 package. The entry points in bindir +# will be provided by the python2 package. +%patch0 -p1 + rm -rf %{py3dir} cp -a . %{py3dir} %build %{__python2} setup.py build -( cd %{py3dir} && %{__python3} setup.py build ) +( cd %{py3dir} && %{__python3} setup3.py build ) %install -# Do python3 first to install and move the binaries out of the way -( cd %{py3dir} && %{__python3} setup.py install --skip-build --root %{buildroot} ) - -# Add a python3- prefix to the binaries -mv %{_bindir}/diff-cover %{_bindir}/python3-diff-cover -mv %{_bindir}/diff-quality %{_bindir}/python3-diff-quality - %{__python2} setup.py install --skip-build --root %{buildroot} +( cd %{py3dir} && %{__python3} setup3.py install --skip-build --root %{buildroot} ) + # Generate documentation for the scripts mkdir -p %{buildroot}%{_mandir}/man1 PYTHONPATH=%{buildroot}%{python2_sitelib} \ @@ -125,19 +113,6 @@ PYTHONPATH=%{buildroot}%{python2_sitelib} \ -o %{buildroot}%{_mandir}/man1/diff-quality.1 \ %{buildroot}%{_bindir}/diff-quality -PYTHONPATH=%{buildroot}%{python3_sitelib} \ - help2man --no-info --version-string 'python3-diff-cover %{version}' \ - -o %{buildroot}%{_mandir}/man1/python3-diff-cover.1 \ - %{buildroot}%{_bindir}/python3-diff-cover - -PYTHONPATH=%{buildroot}%{python3_sitelib} \ - help2man --no-info --version-string 'python3-diff-quality %{version}' \ - -o %{buildroot}%{_mandir}/man1/python3-diff-quality.1 \ - %{buildroot}%{_bindir}/python3-diff-quality - -mv %{_mandir}/man1/diff-cover.1 %{_mandir}/man1/python3-diff-cover.1 -mv %{_mandir}/man1/diff-quality.1 %{_mandir}/man1/python3-diff-quality.1 - %check nosetests -v %{__python3} -m nose @@ -153,20 +128,10 @@ nosetests -v %files -n python3-diff-cover %doc AUTHORS LICENSE README.rst -%{_bindir}/python3-diff-cover -%{_bindir}/python3-diff-quality -%{_mandir}/man1/python3-diff-cover.1* -%{_mandir}/man1/python3-diff-quality.1* %{python3_sitelib}/diff_cover %{python3_sitelib}/diff_cover-%{version}-*.egg-info %changelog -* Fri Dec 12 2014 David Shea - 0.7.3-1 -- Added pylint support! -- Fixed bug around python 1.6 and pyflakes -- Update Pygments allowing us to remove code we grabbed from the development branch of the project used to support python3 correctly -- provide python3 binaries as python3-diff-* - * Fri Nov 7 2014 David Shea - 0.7.2-1 - bugfix around prasing of options - enable nosetests in spec file diff --git a/sources b/sources index 7a6979b..3cfab5b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -2c188e01998154bcf2649cb8487cc162 diff_cover-0.7.3.tar.gz +69a3cbdf5f0d3da48b504730ecb2e0f1 diff_cover-0.7.2.tar.gz