%if 0%{?fedora} %global with_python3 1 %endif %{!?_licensedir: %global license %%doc} %if 0%{?rhel} && 0%{?rhel} <= 6 %{!?__python2: %global __python2 /usr/bin/python2} %{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} %endif %global modname vcrpy Name: python-vcrpy Version: 1.4.0 Release: 1%{?dist} Summary: Automatically mock your HTTP interactions to simplify and speed up testing Group: Development/Libraries License: MIT URL: http://pypi.python.org/pypi/vcrpy Source0: https://pypi.python.org/packages/source/v/%{modname}/%{modname}-%{version}.tar.gz BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-setuptools BuildRequires: PyYAML BuildRequires: python-mock BuildRequires: python-six BuildRequires: python-contextlib2 BuildRequires: python-wrapt #BuildRequires: python-backport_collections Requires: PyYAML Requires: python-mock Requires: python-six Requires: python-contextlib2 Requires: python-wrapt #Requires: python-backport_collections %if 0%{?with_python3} BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-PyYAML BuildRequires: python3-mock BuildRequires: python3-six BuildRequires: python3-contextlib2 BuildRequires: python3-wrapt #BuildRequires: python3-backport_collections Requires: python3-PyYAML Requires: python3-mock Requires: python3-six Requires: python3-contextlib2 Requires: python3-wrapt #Requires: python3-backport_collections %endif %description Simplify and speed up testing HTTP by recording all HTTP interactions and saving them to "cassette" files, which are yaml files containing the contents of your requests and responses. Then when you run your tests again, they all just hit the text files instead of the internet. This speeds up your tests and lets you work offline. If the server you are testing against ever changes its API, all you need to do is delete your existing cassette files, and run your tests again. All of the mocked responses will be updated with the new API. %if 0%{?with_python3} %package -n python3-vcrpy Summary: Automatically mock your HTTP interactions to simplify and speed up testing Group: Development/Libraries %description -n python3-vcrpy Simplify and speed up testing HTTP by recording all HTTP interactions and saving them to "cassette" files, which are yaml files containing the contents of your requests and responses. Then when you run your tests again, they all just hit the text files instead of the internet. This speeds up your tests and lets you work offline. If the server you are testing against ever changes its API, all you need to do is delete your existing cassette files, and run your tests again. All of the mocked responses will be updated with the new API. %endif %prep %setup -q -n %{modname}-%{version} sed -i "s/backport_collections/collections/g" vcr/filters.py sed -i "s/backport_collections/collections/g" vcr/cassette.py sed -i "s/, 'backport_collections'//g" setup.py # Remove bundled egg-info in case it exists rm -rf %{modname}.egg-info %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} %endif %build %{__python2} setup.py build %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py build popd %endif %install %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py install -O1 --skip-build --root=%{buildroot} popd %endif %{__python2} setup.py install -O1 --skip-build --root=%{buildroot} ## Cannot run tests because they require python-pytest-localserver which is not ## yet packaged. #%%check #%%{__python2} setup.py test #%%if 0%%{?with_python3} #pushd %%{py3dir} #%%{__python3} setup.py test #popd #%%endif %files # No readme or license yet # https://github.com/kevin1024/vcrpy/pull/148 #%doc README.md #%license LICENSE.txt %{python2_sitelib}/%{modname}/ %{python2_sitelib}/%{modname}-%{version}* %if 0%{?with_python3} %files -n python3-vcrpy # No readme or license yet # https://github.com/kevin1024/vcrpy/pull/148 #%doc README.md #%license LICENSE.txt %{python3_sitelib}/%{modname}/ %{python3_sitelib}/%{modname}-%{version}* %endif %changelog * Sat Apr 11 2015 <> 1.4.0-1 - initial package for Fedora