%define name python3-hypothesis %define srcname hypothesis %define version 4.47.4 %define release 1 # Tests by default. No tests: rpm -ba --define 'dotests 0' *.spec %{!?dotests: %define dotests 1} # Needs care because default command python may be linked to 32 or 64 bit python # and compiler/loader options are not the same, e.g. -maix32/-maix64 # Also, although # /usr/bin/python_64 eventually links to /opt/freeware/bin/python2.7_64 # /usr/bin/python_32 links to inexistant /opt/freeware/bin/python2_32 # So, use /opt/freeware/bin/python2.7 and /opt/freeware/bin/python2.7_64 %define is_python %(test -e /opt/freeware/bin/python3_32 && echo 1 || echo 0) %if %{is_python} %define python_sitelib %(/opt/freeware/bin/python3_32 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") %endif %define _libdir64 %{_prefix}/lib64 %define is_python_64 %(test -e /opt/freeware/bin/python3 && echo 1 || echo 0) %if %{is_python_64} %define python_sitelib64 %(/opt/freeware/bin/python3 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") %endif Name: %{name} Version: %{version} Release: %{release} Group: Development/Libraries Summary: A library for property based testing License: MPLv2.0 URL: https://github.com/DRMacIver/hypothesis Source0: https://github.com/DRMacIver/hypothesis/archive/%{version}.tar.gz#/hypothesis-%{version}.tar.gz # disable Sphinx extensions that require Internet access # Patch0: %{srcname}-2.0.0-offline.patch BuildArch: noarch BuildRequires: python-devel BuildRequires: python3-sphinx Requires: python3-attrs >= 19.2.0 Provides: python-hypothesis = %{version}-%{release} #BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Prefix: %{_prefix} #Source10: %{name}-%{version}-%{release}.build.log %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. # %package -n python3-%{srcname} # Summary: A library for property based testing # Provides: python3-hypothesis = %{version}-%{release} # # Suggests: python3-numpy # Suggests: python3-pytz # # %description -n python3-%{srcname} # 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. %prep %setup -q -n %{srcname}-%{version} echo "dotests=%{dotests}" # %patch1 -p1 # A python3 build/install is not yet supported %build # First build the 64-bit version /opt/freeware/bin/python3 setup.py build # Pb inline in sphinx/docutils # READTHEDOCS=True sphinx-build -b man docs docs/_build/man # %py3_build # A python3 build/install is not yet supported %install [ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT /opt/freeware/bin/python3 setup.py install --skip-build --prefix=%{_prefix} --root ${RPM_BUILD_ROOT} # %py3_install # Currently there are no tests %if %{dotests} %check PYTHONPATH=%{buildroot}%{python_sitelib} pytest-3 -v -k "not test_healthcheck_traceback_is_hidden" || true %endif %files -n python3-%{srcname} %doc LICENSE.txt README.rst %{python_sitelib}/* %changelog * Tue Dec 24 2019 Harshita Jain - 4.47.4-1 - Build with python3 - Update to latest version * Mon May 15 2017 Michael Wilson - 3.4.0-1 - Initial version