python-sure/python-sure.spec

123 lines
3.0 KiB
RPMSpec
Raw Normal View History

2021-06-23 16:46:12 +00:00
%global srcname sure
2012-06-27 05:37:41 +00:00
2021-06-23 16:46:12 +00:00
Name: python-%{srcname}
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
License: GPLv3+
2021-06-23 16:46:12 +00:00
URL: https://github.com/gabrielfalcao/%{srcname}
Source0: %{url}/archive/%{version}/%{srcname}-%{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
Source1: %{srcname}.1
2020-01-06 13:20:09 +00:00
# Python 3.10 workaround
# In test_context_is_not_optional(), only check the exception type
# https://github.com/gabrielfalcao/sure/issues/169
2021-06-24 16:23:52 +00:00
Patch0: python3.10-workaround.patch
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
BuildRequires: pyproject-rpm-macros
# TODO: remove mock dependency from install_requires
# https://fedoraproject.org/wiki/Changes/DeprecatePythonMock
# https://github.com/gabrielfalcao/sure/pull/161
# Test dependencies
2021-06-24 12:09:54 +00:00
# TODO: remove the test dependency on nose
# https://fedoraproject.org/wiki/Changes/DeprecateNose
BuildRequires: python3dist(nose)
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)
2021-06-24 16:23:52 +00:00
# development.txt: pytest-cov==2.12.1
# (We dont need coverage reports, but it is easier to add the dependency than
# to patch setup.cfg.)
BuildRequires: python3dist(pytest-cov)
2021-06-24 16:23:52 +00:00
# Documentation dependencies
BuildRequires: make
2021-06-24 16:23:52 +00:00
# development.txt: Sphinx==2.3.1
BuildRequires: python3dist(sphinx)
2021-06-24 16:23:52 +00:00
# development.txt: sphinx-rtd-theme==0.4.3
BuildRequires: python3dist(sphinx-rtd-theme)
BuildRequires: python3-docs
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. Sures developer experience is inspired and modeled
after RSpec Expectations and should.js.}
%description %{common_description}
2018-05-17 10:40:11 +00:00
2021-06-24 12:09:54 +00:00
%generate_buildrequires
%pyproject_buildrequires -r
2021-06-23 16:46:12 +00:00
%package -n python3-%{srcname}
2021-06-24 12:00:12 +00:00
Summary: %{summary}
2021-06-24 12:00:12 +00:00
%description -n python3-%{srcname} %{common_description}
2018-05-17 10:40:11 +00:00
%package doc
Summary: Documentation for Sure
Requires: python3-docs
%description doc %{common_description}
2012-06-27 05:37:41 +00:00
%prep
2021-06-23 16:46:12 +00:00
%autosetup -p1 -n %{srcname}-%{version}
# Use local inventories in intersphinx mappings.
#
# Currently, python-redis does not package the Sphinx documentation, so we
# remove that mapping:
# 'redis': ('https://redis-py.readthedocs.io/en/latest/', None)
sed -r -i \
-e 's|https://docs.python.org/3?|/%{_docdir}/python3-docs/html|' \
-e '/redis.*https.*readthedocs/d' \
docs/source/conf.py
2021-06-24 16:23:52 +00:00
cp -p '%{SOURCE1}' .
2018-05-17 10:40:11 +00:00
2012-06-27 05:37:41 +00:00
%build
2021-06-24 12:09:54 +00:00
%pyproject_wheel
2021-06-24 12:32:17 +00:00
env PYTHONPATH="${PWD}" %make_build -C docs/ html SPHINXOPTS='%{?_smp_mflags}'
2021-07-21 13:57:42 +00:00
rm -vf docs/_build/html/.buildinfo
2018-05-17 10:40:11 +00:00
2012-06-27 05:37:41 +00:00
%install
2021-06-24 12:09:54 +00:00
%pyproject_install
%pyproject_save_files %{srcname}
2018-05-17 10:40:11 +00:00
2021-06-24 16:23:52 +00:00
install -t '%{buildroot}%{_mandir}/man1' -D -p -m 0644 %{srcname}.1
2012-06-27 05:37:41 +00:00
%check
%pytest
2018-05-17 10:40:11 +00:00
2021-06-24 12:09:54 +00:00
%files -n python3-%{srcname} -f %{pyproject_files}
2021-06-24 11:54:22 +00:00
%license COPYING
2021-06-24 16:23:52 +00:00
%{_bindir}/%{srcname}
%{_mandir}/man1/%{srcname}.1*
%files doc
%license COPYING
%doc CHANGELOG.md
%doc README.rst
%doc TODO.rst
%doc docs/build/html
2018-05-17 10:40:11 +00:00
2012-06-27 05:37:41 +00:00
%changelog
2021-07-21 13:56:46 +00:00
%autochangelog