Blame python-vulture.spec

3eabb0
%bcond_without python3
3eabb0
3eabb0
%global module_name vulture
3eabb0
%global common_desc \
3eabb0
Vulture finds unused classes, functions and variables in your code. \
3eabb0
This helps you cleanup and find errors in your programs. If you run it \
3eabb0
on both your library and test suite you can find untested code. \
3eabb0
Due to Python’s dynamic nature, static code analyzers like vulture \
3eabb0
are likely to miss some dead code. Also, code that is only called \
3eabb0
implicitly may be reported as unused. Nonetheless, vulture can be a \
3eabb0
very helpful tool for higher code quality.
3eabb0
3eabb0
Name:		python-%{module_name}
0aa051
Version:	0.27
0aa051
Release:	1%{?dist}
3eabb0
Summary:	Find Dead Code
3eabb0
3eabb0
License:	MIT
3eabb0
URL:		https://pypi.python.org/pypi/vulture
3eabb0
Source0:	https://files.pythonhosted.org/packages/source/v/%{module_name}/%{module_name}-%{version}.tar.gz
3eabb0
3eabb0
BuildArch:	noarch
3eabb0
3eabb0
%description
3eabb0
%{common_desc}
3eabb0
3eabb0
%package -n	python2-%{module_name}
3eabb0
Summary:	Find Dead Code
3eabb0
%{?python_provide:%python_provide python2-%{module_name}}
3eabb0
3eabb0
BuildRequires:	python2-devel
607a5c
BuildRequires:	python2-setuptools
3eabb0
# Required by tests
3eabb0
BuildRequires:	python2-pytest
3eabb0
BuildRequires:	python2-pytest-cov
3eabb0
607a5c
Requires:	python2-setuptools
3eabb0
3eabb0
%description -n	python2-%{module_name}
3eabb0
%{common_desc}
3eabb0
3eabb0
%if %{with python3}
3eabb0
%package -n	python3-%{module_name}
3eabb0
Summary:	Find Dead Code
3eabb0
%{?python_provide:%python_provide python3-%{module_name}}
3eabb0
3eabb0
BuildRequires:	python3-devel
3eabb0
BuildRequires:	python3-setuptools
3eabb0
# Required by tests
3eabb0
BuildRequires:	python3-pytest
3eabb0
BuildRequires:	python3-pytest-cov
3eabb0
3eabb0
Requires:	python3-setuptools
3eabb0
%description -n	python3-%{module_name}
3eabb0
%{common_desc}
3eabb0
%endif
3eabb0
3eabb0
%prep
3eabb0
%autosetup -n	%{module_name}-%{version}
3eabb0
# Remove shebang
dd29d1
sed -i '1{/^#!/d}' vulture/*.py
3eabb0
3eabb0
%build
3eabb0
%py2_build
3eabb0
%if %{with python3}
3eabb0
%py3_build
3eabb0
%endif
3eabb0
3eabb0
%install
3eabb0
%if %{with python3}
3eabb0
%py3_install
3eabb0
mv %{buildroot}%{_bindir}/%{module_name} %{buildroot}%{_bindir}/%{module_name}-%{python3_version}
3eabb0
%endif
3eabb0
%py2_install
3eabb0
mv %{buildroot}%{_bindir}/%{module_name} %{buildroot}%{_bindir}/%{module_name}-%{python2_version}
3eabb0
3eabb0
ln -s %{_bindir}/vulture-%{python3_version} %{buildroot}/%{_bindir}/vulture-3
3eabb0
ln -s %{_bindir}/vulture-%{python2_version} %{buildroot}/%{_bindir}/vulture-2
3eabb0
ln -s %{_bindir}/vulture-%{python2_version} %{buildroot}/%{_bindir}/vulture
3eabb0
3eabb0
%check
dd29d1
export PYTHONPATH=.
3eabb0
py.test-2
3eabb0
%if %{with python3}
3eabb0
py.test-3
3eabb0
%endif
3eabb0
3eabb0
%files -n	python2-%{module_name}
3eabb0
%doc README.rst
3eabb0
%license LICENSE.txt
3eabb0
%{_bindir}/%{module_name}
3eabb0
%{_bindir}/%{module_name}-2
3eabb0
%{_bindir}/%{module_name}-%{python2_version}
dd29d1
%{python2_sitelib}/%{module_name}
3eabb0
%{python2_sitelib}/%{module_name}-%{version}-py?.?.egg-info
3eabb0
3eabb0
%if %{with python3}
3eabb0
%files -n	python3-%{module_name}
3eabb0
%doc README.rst
3eabb0
%license LICENSE.txt
3eabb0
%{_bindir}/%{module_name}-3
3eabb0
%{_bindir}/%{module_name}-%{python3_version}
dd29d1
%{python3_sitelib}/%{module_name}/__pycache__
dd29d1
%{python3_sitelib}/%{module_name}
3eabb0
%{python3_sitelib}/%{module_name}-%{version}-py?.?.egg-info
3eabb0
%endif
3eabb0
3eabb0
%changelog
0aa051
* Fri Jun 29 2018 Yatin Karel <ykarel@redhat.com> - 0.27-1
0aa051
- Update to 0.27 (#1586070)
0aa051
380af0
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.26-3
380af0
- Rebuilt for Python 3.7
380af0
e91fff
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.26-2
e91fff
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
e91fff
4dbb5e
* Mon Aug 28 2017 Fedora Release Monitoring  <release-monitoring@fedoraproject.org> - 0.26-1
4dbb5e
- Update to 0.26 (#1485917)
4dbb5e
f0be9a
* Wed Aug 16 2017 Fedora Release Monitoring  <release-monitoring@fedoraproject.org> - 0.25-1
f0be9a
- Update to 0.25 (#1472024)
f0be9a
0309b8
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.16-2
0309b8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
0309b8
dd29d1
* Mon Jul 17 2017 Yatin Karel <ykarel@redhat.com> - 0.16-1
dd29d1
- Sync with upstream release 0.16
dd29d1
4e6ba0
* Wed Jul 05 2017 Yatin Karel <ykarel@redhat.com> - 0.14-3
4e6ba0
- Fix Changelog release
4e6ba0
607a5c
* Wed Jul 05 2017 Yatin Karel <ykarel@redhat.com> - 0.14-2
607a5c
- Use versioned package, python2-setuptools(not python-setuptools)
607a5c
3eabb0
* Tue Jun 20 2017 Yatin Karel <ykarel@redhat.com> - 0.14-1
3eabb0
- Initial package import
3eabb0