diff options
author | Michel Alexandre Salim <michel@michel-slm.name> | 2015-07-24 23:41:42 +0700 |
---|---|---|
committer | Michel Alexandre Salim <michel@michel-slm.name> | 2015-07-24 23:41:42 +0700 |
commit | 6b7b4e0cd41acfc05b628aac2ce5431e9adeb990 (patch) | |
tree | 1d09b0a4ecf60826890be2b898f5bb7f7d36ecc2 | |
parent | 9a259143b2f02cad4dfeb5b490d3619e2e235c99 (diff) | |
download | specs-6b7b4e0cd41acfc05b628aac2ce5431e9adeb990.tar.gz specs-6b7b4e0cd41acfc05b628aac2ce5431e9adeb990.tar.xz specs-6b7b4e0cd41acfc05b628aac2ce5431e9adeb990.zip |
add python-hypothesis
-rw-r--r-- | python/python-hypothesis.spec | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/python/python-hypothesis.spec b/python/python-hypothesis.spec new file mode 100644 index 0000000..6685624 --- /dev/null +++ b/python/python-hypothesis.spec @@ -0,0 +1,115 @@ +%global pkgname hypothesis + +%if 0%{?fedora} +%bcond_without python3 +%else +%bcond_with python3 +%endif + +Name: python-%{pkgname} +Version: 1.8.2 +Release: 1%{?dist} +Summary: A library for property based testing + +License: MPLv2.0 +URL: https://github.com/DRMacIver/hypothesis +Source0: https://github.com/DRMacIver/hypothesis/archive/v%{version}.tar.gz#/hypothesis-%{version}.tar.gz + +BuildArch: noarch +BuildRequires: python2-devel +# Test dependencies +BuildRequires: pytest +BuildRequires: python-flake8 +%if %{with python3} +BuildRequires: python3-devel +BuildRequires: python3-pytest +BuildRequires: python3-flake8 +%endif # with python3 + +%description +Hypothesis is a library for testing your Python code against a much +larger range of examples than you would ever want to write by +hand. It’s based on the Haskell library, Quickcheck, and is designed +to integrate seamlessly into your existing Python unit testing work +flow. + + +%if %{with python3} +%package -n python3-%{pkgname} +Summary: A library for property based testing + +%description -n python3-%{pkgname} +Hypothesis is a library for testing your Python code against a much +larger range of examples than you would ever want to write by +hand. It’s based on the Haskell library, Quickcheck, and is designed +to integrate seamlessly into your existing Python unit testing work +flow. + +%endif # with python3 + + +%prep +%setup -qc +mv %{pkgname}-%{version} python2 + +%if %{with python3} +cp -a python2 python3 +%endif # with python3 + + +%build +pushd python2 +%{__python2} setup.py build +popd + +%if %{with python3} +pushd python3 +%{__python3} setup.py build +popd +%endif # with python3 + + +%install +rm -rf $RPM_BUILD_ROOT +# Must do the python3 install first because the scripts in /usr/bin are +# overwritten with every setup.py install (and we want the python2 version +# to be the default for now). +%if %{with python3} +pushd python3 +%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT +popd +%endif # with python3 + +pushd python2 +%{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT +popd + + +%check +pushd python2 +%{__python2} setup.py test +popd + +%if %{with python3} +pushd python3 +%{__python3} setup.py test +popd +%endif + + +%files +%license python2/LICENSE.txt +%doc python2/README.rst +%{python2_sitelib}/* + +%if %{with python3} +%files -n python3-%{pkgname} +%license python3/LICENSE.txt +%doc python3/README.rst +%{python3_sitelib}/* +%endif # with python3 + + +%changelog +* Thu Jul 23 2015 Michel Alexandre Salim <salimma@fedoraproject.org> - 1.8.2-1 +- Initial package |