You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
python-hypothesis/python-hypothesis.spec

120 lines
3.3 KiB

Name: python-hypothesis
3 years ago
Version: 6.24.2
Release: %autorelease
Summary: Library for property based testing
10 years ago
License: MPLv2.0
4 years ago
URL: https://github.com/HypothesisWorks/hypothesis
Source0: %{url}/archive/hypothesis-python-%{version}/hypothesis-%{version}.tar.gz
10 years ago
BuildArch: noarch
# Needs pytest and others, but hypothesis is built sooner than pytest when bootstrapping
%bcond_without tests
%bcond_without doc
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: pyproject-rpm-macros >= 0-43
%if %{with tests}
4 years ago
# optional test dependencies:
BuildRequires: %{py3_dist typing_extensions}
%endif
4 years ago
%if %{with doc}
BuildRequires: %{_bindir}/sphinx-build
BuildRequires: %{py3_dist sphinx-hoverxref}
BuildRequires: %{py3_dist sphinx-rtd-theme}
BuildRequires: %{py3_dist sphinx_selective_exclude}
%endif
%global _description %{expand:
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. Its based on the Haskell library, Quickcheck, and is designed
to integrate seamlessly into your existing Python unit testing work
flow.}
9 years ago
%description %{_description}
%package -n python%{python3_pkgversion}-hypothesis
Summary: %{summary}
10 years ago
%description -n python%{python3_pkgversion}-hypothesis %{_description}
%global extras cli,ghostwriter,pytz,dateutil,lark,numpy,pandas,pytest,redis,zoneinfo,django
# extras with missing deps:
# codemods: libcst
# dpcontracts: dpcontracts
%{pyproject_extras_subpkg -n python%{python3_pkgversion}-hypothesis %{extras}}
10 years ago
%prep
%autosetup -n hypothesis-hypothesis-python-%{version}/hypothesis-python -p2
# disable Sphinx extensions that require Internet access
sed -i -e '/sphinx.ext.intersphinx/d' docs/conf.py
3 years ago
# disable Sphinx non-available extensions
sed -i -e '/sphinx_codeautolink/d' docs/conf.py
9 years ago
%generate_buildrequires
%pyproject_buildrequires %{?with_tests:../requirements/test.in -x %{extras}}
10 years ago
%build
%pyproject_wheel
%if %{with doc}
PYTHONPATH=src READTHEDOCS=True sphinx-build -b man docs docs/_build/man
%endif
10 years ago
%install
%pyproject_install
%pyproject_save_files hypothesis
%if %{with doc}
install -Dpm0644 -t %{buildroot}%{_mandir}/man1 docs/_build/man/hypothesis.1
%endif
10 years ago
%if %{with tests}
%check
k="not test_registered_from_entrypoint"
# https://github.com/HypothesisWorks/hypothesis/issues/3035
k="$k and not test_recursion_error_is_not_flaky"
# https://github.com/pandas-dev/pandas/commit/95a86a9884e
%if "%{_arch}" == "s390x"
k="$k and not test_data_frames_with_timestamp_columns"
%endif
%pytest -v -n auto -k "$k" \
4 years ago
--ignore tests/codemods \
--ignore tests/dpcontracts \
--ignore tests/redis \
# The BRP that handles bytecompilation already run at the end of %%install.
# This autogenerated file gets re-generated during tests,
# the tests asserts the content is identical, but the mtime is changed anyway.
# Since %%pytest disables byte-compilation, we need to update the pycs manually:
%py_byte_compile %{python3} %{buildroot}%{python3_sitelib}/hypothesis/internal/conjecture/shrinking/learned_dfas.py
%endif
%files -n python%{python3_pkgversion}-hypothesis -f %{pyproject_files}
%license ../LICENSE.txt
9 years ago
%doc README.rst
%{_bindir}/hypothesis
%if %{with doc}
9 years ago
%{_mandir}/man1/hypothesis.1*
%endif
10 years ago
%changelog
%autochangelog