Blob Blame History Raw
%global pypi_name pytest-watch
%global file_name pytest_watch
%global desc A zero-config CLI tool that runs [pytest][], and re-runs it \
when a file in your project changes. It beeps on failures and can run arbitrary \
commands on each passing and failing test run.


Name:           python-%{pypi_name}
Version:        4.1.0
Release:        11%{?dist}
Summary:        Local continuous test runner with pytest and watchdog

License:        MIT
URL:            https://pypi.python.org/pypi/pytest-watch
Source0:        https://pypi.python.org/packages/e9/88/69b94fe4cb3d3b106b184056bc80ade6b0a9062e5a9a1cb65aec58831281/%{pypi_name}-%{version}.zip
Patch0:         choose-default-pytest-command-depending-on-python-version.patch
BuildArch:      noarch

%description
%{desc}


%package -n     python2-%{pypi_name}
BuildArch:      noarch
BuildRequires:  python2-devel
Requires:       python2-colorama >= 0.3.3
Requires:       python2-docopt >= 0.6.2
Requires:       python2-pytest >= 2.6.4
Requires:       python2-watchdog >= 0.6.0
# Require missing watchdog deps for the package to work
# See: https://bugzilla.redhat.com/show_bug.cgi?id=1360383
Requires:       python2-pyyaml
Requires:       python2-argh
Requires:       python2-pathtools
Summary:        %{summary}
%{?python_provide:%python_provide python2-%{pypi_name}}

%description -n python2-%{pypi_name}
%{desc}


%package -n     python3-%{pypi_name}
Summary:        %{summary}
BuildArch:      noarch
BuildRequires:  python3-devel
Requires:       python3-colorama >= 0.3.3
Requires:       python3-docopt >= 0.6.2
Requires:       python3-pytest >= 2.6.4
Requires:       python3-watchdog >= 0.6.0
# Require missing watchdog deps for the package to work
# See: https://bugzilla.redhat.com/show_bug.cgi?id=1360383
Requires:       python3-PyYAML
Requires:       python3-argh
Requires:       python3-pathtools
%{?python_provide:%python_provide python3-%{pypi_name}}

%description -n python3-%{pypi_name}
%{desc}


%prep
%setup -qn %{pypi_name}-%{version}
# Correct end of line encoding
sed -i 's/\r$//' *.md
sed -i 's/\r$//' %{file_name}/watcher.py
%patch0 -p1


%build
%py3_build
%py2_build



%install
# Put unversionned binary with python 2, like py.test
%py3_install
pushd %{buildroot}%{_bindir}
mv ptw ptw-%{python3_version}
ln -s ptw-%{python3_version} ptw-3
mv pytest-watch pytest-watch-%{python3_version}
ln -s pytest-watch-%{python3_version} pytest-watch-3
popd

%py2_install
pushd %{buildroot}%{_bindir}
mv ptw ptw-%{python2_version}
ln -s ptw-%{python2_version} ptw-2
ln -s ptw-%{python2_version} ptw
mv pytest-watch pytest-watch-%{python2_version}
ln -s pytest-watch-%{python2_version} pytest-watch-2
ln -s pytest-watch-%{python2_version} pytest-watch
popd


%files -n python2-%{pypi_name}
%doc README.md CHANGES.md AUTHORS.md
%license LICENSE
%{python2_sitelib}/%{file_name}-%{version}-py%{python2_version}.egg-info/
%{python2_sitelib}/%{file_name}/
%exclude %{_bindir}/ptw-3*
%exclude %{_bindir}/pytest-watch-3*
%{_bindir}/ptw*
%{_bindir}/pytest-watch*


%files -n python3-%{pypi_name}
%doc README.md CHANGES.md AUTHORS.md
%license LICENSE
%{python3_sitelib}/%{file_name}-%{version}-py%{python3_version}.egg-info/
%{python3_sitelib}/%{file_name}/
%{_bindir}/ptw-3*
%{_bindir}/pytest-watch-3*


%changelog
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.0-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.0-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 4.1.0-9
- Rebuilt for Python 3.7

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Sat Jan 27 2018 Iryna Shcherbina <ishcherb@redhat.com> - 4.1.0-7
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 4.1.0-4
- Rebuild for Python 3.6

* Tue Sep 06 2016 Julien Enselme <jujens@jujens.eu> - 4.1.0-3
- Choose default py.test command based on Python version

* Thu Aug 11 2016 Julien Enselme <jujens@jujens.eu> - 4.1.0-2
- Remove usage of uneeded %%sum macro
- Correct symlink order
- Don't remove upstream egg-info

* Tue Jul 26 2016 Julien Enselme <jujens@jujens.eu> - 4.1.0-1
- Inital package