2021-09-28 20:10:39 +00:00
|
|
|
|
# Sphinx-generated HTML documentation is not suitable for packaging; see
|
|
|
|
|
# https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for discussion.
|
|
|
|
|
#
|
2021-11-25 14:29:11 +00:00
|
|
|
|
# We can generate PDF documentation as a substitute.
|
2021-09-28 20:10:39 +00:00
|
|
|
|
%bcond_without doc_pdf
|
|
|
|
|
|
2021-09-13 19:53:02 +00:00
|
|
|
|
Name: python-sure
|
2021-06-24 16:23:52 +00:00
|
|
|
|
Version: 2.0.0
|
2021-07-21 13:56:46 +00:00
|
|
|
|
Release: %autorelease
|
2021-06-24 12:00:12 +00:00
|
|
|
|
Summary: Idiomatic assertion toolkit with human-friendly failure messages
|
2012-06-27 05:37:41 +00:00
|
|
|
|
|
2022-11-28 14:50:27 +00:00
|
|
|
|
License: GPL-3.0-or-later
|
2021-09-13 19:53:02 +00:00
|
|
|
|
URL: https://github.com/gabrielfalcao/sure
|
|
|
|
|
Source0: %{url}/archive/%{version}/sure-%{version}.tar.gz
|
2020-01-06 13:20:09 +00:00
|
|
|
|
|
2021-06-24 16:23:52 +00:00
|
|
|
|
# Trivial downstream man page for (nearly pointless) executable
|
2021-09-13 19:53:02 +00:00
|
|
|
|
Source1: sure.1
|
2020-01-06 13:20:09 +00:00
|
|
|
|
|
2020-10-23 08:38:42 +00:00
|
|
|
|
# Python 3.10 workaround
|
|
|
|
|
# In test_context_is_not_optional(), only check the exception type
|
|
|
|
|
# https://github.com/gabrielfalcao/sure/issues/169
|
2022-04-16 12:26:55 +00:00
|
|
|
|
Patch: python3.10-workaround.patch
|
2020-10-23 08:38:42 +00:00
|
|
|
|
|
2012-06-27 05:37:41 +00:00
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
2018-05-17 10:37:49 +00:00
|
|
|
|
BuildRequires: python3-devel
|
2021-06-24 12:09:54 +00:00
|
|
|
|
|
|
|
|
|
# TODO: remove mock dependency from install_requires
|
|
|
|
|
# https://fedoraproject.org/wiki/Changes/DeprecatePythonMock
|
|
|
|
|
# https://github.com/gabrielfalcao/sure/pull/161
|
|
|
|
|
|
2021-06-24 12:15:00 +00:00
|
|
|
|
# Test dependencies
|
2021-06-24 16:23:52 +00:00
|
|
|
|
# development.txt: pytest==6.2.4
|
2021-06-24 12:09:54 +00:00
|
|
|
|
BuildRequires: python3dist(pytest)
|
2013-11-29 10:57:08 +00:00
|
|
|
|
|
2021-06-24 16:23:52 +00:00
|
|
|
|
# Documentation dependencies
|
2021-09-28 20:10:39 +00:00
|
|
|
|
%if %{with doc_pdf}
|
2021-06-24 12:15:00 +00:00
|
|
|
|
BuildRequires: make
|
2021-06-24 16:23:52 +00:00
|
|
|
|
# development.txt: Sphinx==2.3.1
|
2021-06-24 12:15:00 +00:00
|
|
|
|
BuildRequires: python3dist(sphinx)
|
2021-06-24 16:23:52 +00:00
|
|
|
|
# development.txt: sphinx-rtd-theme==0.4.3
|
2021-06-24 12:15:00 +00:00
|
|
|
|
BuildRequires: python3dist(sphinx-rtd-theme)
|
2021-09-28 20:10:39 +00:00
|
|
|
|
BuildRequires: python3-sphinx-latex
|
|
|
|
|
BuildRequires: latexmk
|
|
|
|
|
%endif
|
2021-06-24 12:15:00 +00:00
|
|
|
|
|
2021-06-24 12:00:12 +00:00
|
|
|
|
%global common_description %{expand:
|
|
|
|
|
An idiomatic testing library for python with powerful and flexible assertions
|
|
|
|
|
created by Gabriel Falcão. Sure’s developer experience is inspired and modeled
|
|
|
|
|
after RSpec Expectations and should.js.}
|
|
|
|
|
|
|
|
|
|
%description %{common_description}
|
2016-12-21 17:35:38 +00:00
|
|
|
|
|
2018-05-17 10:40:11 +00:00
|
|
|
|
|
2021-09-13 19:53:02 +00:00
|
|
|
|
%package -n python3-sure
|
2021-06-24 12:00:12 +00:00
|
|
|
|
Summary: %{summary}
|
2013-11-29 10:57:08 +00:00
|
|
|
|
|
2021-09-13 19:53:02 +00:00
|
|
|
|
%description -n python3-sure %{common_description}
|
2018-05-17 10:40:11 +00:00
|
|
|
|
|
2013-11-29 10:57:08 +00:00
|
|
|
|
|
2021-06-24 12:15:00 +00:00
|
|
|
|
%package doc
|
|
|
|
|
Summary: Documentation for Sure
|
|
|
|
|
|
|
|
|
|
%description doc %{common_description}
|
|
|
|
|
|
|
|
|
|
|
2012-06-27 05:37:41 +00:00
|
|
|
|
%prep
|
2021-09-13 19:53:02 +00:00
|
|
|
|
%autosetup -p1 -n sure-%{version}
|
2013-11-29 10:57:08 +00:00
|
|
|
|
|
2022-01-07 15:21:44 +00:00
|
|
|
|
# Drop intersphinx mappings, since we can’t download remote inventories and
|
|
|
|
|
# can’t easily produce working hyperlinks from inventories in local
|
|
|
|
|
# documentation packages.
|
2022-04-16 12:26:23 +00:00
|
|
|
|
echo 'intersphinx_mapping.clear()' >> docs/source/conf.py
|
2021-06-24 12:21:30 +00:00
|
|
|
|
|
2021-12-17 18:09:58 +00:00
|
|
|
|
# Do not generate a coverage report; this obviates the BR on pytest-cov
|
|
|
|
|
sed -r -i 's/[[:blank:]]--cov=[^[:blank:]]+//' setup.cfg
|
|
|
|
|
|
2018-05-17 10:40:11 +00:00
|
|
|
|
|
2021-07-27 20:28:08 +00:00
|
|
|
|
%generate_buildrequires
|
2022-11-28 14:50:33 +00:00
|
|
|
|
%pyproject_buildrequires
|
2021-07-27 20:28:08 +00:00
|
|
|
|
|
|
|
|
|
|
2012-06-27 05:37:41 +00:00
|
|
|
|
%build
|
2021-06-24 12:09:54 +00:00
|
|
|
|
%pyproject_wheel
|
2021-09-28 20:10:39 +00:00
|
|
|
|
%if %{with doc_pdf}
|
2021-11-25 14:29:11 +00:00
|
|
|
|
PYTHONPATH="${PWD}" %make_build -C docs latex SPHINXOPTS='%{?_smp_mflags}'
|
|
|
|
|
%make_build -C docs/build/latex LATEXMKOPTS='-quiet'
|
2021-09-28 20:10:39 +00:00
|
|
|
|
%endif
|
2018-05-17 10:40:11 +00:00
|
|
|
|
|
2013-11-29 10:57:08 +00:00
|
|
|
|
|
2012-06-27 05:37:41 +00:00
|
|
|
|
%install
|
2021-06-24 12:09:54 +00:00
|
|
|
|
%pyproject_install
|
2021-09-13 19:53:02 +00:00
|
|
|
|
%pyproject_save_files sure
|
2018-05-17 10:40:11 +00:00
|
|
|
|
|
2022-04-16 12:28:17 +00:00
|
|
|
|
install -t '%{buildroot}%{_mandir}/man1' -D -p -m 0644 '%{SOURCE1}'
|
2021-06-24 16:23:52 +00:00
|
|
|
|
|
2013-11-29 10:57:08 +00:00
|
|
|
|
|
2012-06-27 05:37:41 +00:00
|
|
|
|
%check
|
2021-12-17 18:09:58 +00:00
|
|
|
|
# The old_api tests use python3dist(nose), which is deprecated and which we
|
|
|
|
|
# have removed from the BuildRequires:
|
|
|
|
|
# https://fedoraproject.org/wiki/Changes/DeprecateNose
|
|
|
|
|
%pytest --ignore=tests/test_old_api.py
|
2018-05-17 10:40:11 +00:00
|
|
|
|
|
2013-11-29 10:57:08 +00:00
|
|
|
|
|
2021-09-13 19:53:02 +00:00
|
|
|
|
%files -n python3-sure -f %{pyproject_files}
|
|
|
|
|
%{_bindir}/sure
|
|
|
|
|
%{_mandir}/man1/sure.1*
|
2021-06-24 12:15:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%files doc
|
2021-06-24 13:06:00 +00:00
|
|
|
|
%license COPYING
|
2021-06-24 11:55:15 +00:00
|
|
|
|
%doc CHANGELOG.md
|
|
|
|
|
%doc README.rst
|
|
|
|
|
%doc TODO.rst
|
2021-09-28 20:10:39 +00:00
|
|
|
|
%if %{with doc_pdf}
|
|
|
|
|
%doc docs/build/latex/Sure.pdf
|
|
|
|
|
%endif
|
2018-05-17 10:40:11 +00:00
|
|
|
|
|
2013-11-29 10:57:08 +00:00
|
|
|
|
|
2012-06-27 05:37:41 +00:00
|
|
|
|
%changelog
|
2021-07-21 13:56:46 +00:00
|
|
|
|
%autochangelog
|