ralph pushed to python-vcrpy (master). "Initial commit (#1210983)"

notifications at fedoraproject.org notifications at fedoraproject.org
Thu May 14 21:18:56 UTC 2015


From 58b872e2ca7c4a8d9a621c410784693544e0f602 Mon Sep 17 00:00:00 2001
From: Ralph Bean <rbean at redhat.com>
Date: Thu, 14 May 2015 17:18:48 -0400
Subject: Initial commit (#1210983)


diff --git a/.gitignore b/.gitignore
index e69de29..61c82dc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/vcrpy-1.4.2.tar.gz
diff --git a/python-vcrpy.spec b/python-vcrpy.spec
new file mode 100644
index 0000000..52139e8
--- /dev/null
+++ b/python-vcrpy.spec
@@ -0,0 +1,158 @@
+%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.2
+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}/vcr/
+%{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}/vcr/
+%{python3_sitelib}/%{modname}-%{version}*
+%endif
+
+%changelog
+* Wed May 06 2015 Ralph Bean <rbean at redhat.com> - 1.4.2-1
+- Adjusted spec with feedback from package review.
+- Fix original changelog entry.
+- Fix directory ownership in the files section.
+- Latest upstream.
+
+* Sat Apr 11 2015 Ralph Bean <rbean at redhat.com> 1.4.0-1
+- initial package for Fedora
diff --git a/sources b/sources
index e69de29..7d1730a 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+5ff32dcfa52c5acb1cfb0af8094223c4  vcrpy-1.4.2.tar.gz
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/python-vcrpy.git/commit/?h=master&id=58b872e2ca7c4a8d9a621c410784693544e0f602


More information about the scm-commits mailing list