Blame python-TestSlide.spec

d805ab8
# EPEL is missing dependencies required for docs and tests
d805ab8
%if 0%{?rhel}
d805ab8
%bcond_with docs
d805ab8
%bcond_with tests
d805ab8
%else
f1fb246
%bcond_without docs
f1fb246
%bcond_without tests
d805ab8
%endif
0ac3050
0ac3050
%global pypi_name TestSlide
0ac3050
0ac3050
Name:           python-%{pypi_name}
18f412d
Version:        2.6.4
2cf719e
Release:        4%{?dist}
0ac3050
Summary:        A Python test framework
0ac3050
0ac3050
License:        MIT
0ac3050
URL:            https://github.com/facebookincubator/TestSlide
0ac3050
# The PyPI tarball doesn't include tests, so use the original source instead
f1fb246
Source0:        %{url}/archive/%{version}.tar.gz#/%{pypi_name}-%{version}.tar.gz
261c359
# PR#271: move dependency management to requirements.txt and requirements-dev.txt
261c359
Patch0:         %{url}/commit/9a62c484ca9360ea8dfca82b244589c733182449.patch
261c359
# PR#272: requirements: relax dataclasses version dependency
261c359
Patch1:         %{url}/commit/f0a82aa1bf93863794e8a9867cb34df14fdf62a4.patch
261c359
# PR#273: requirements: allow Pygments 2.2.0 or later
261c359
Patch2:         %{url}/commit/fa69263d6eaf07df5090dad4c199d1c6d14abf05.patch
a1ed0dd
%if 0%{?fedora} < 33
a1ed0dd
# pygments 2.4.x in F32 does not support ipython code blocks
a1ed0dd
Patch3:         %{pypi_name}-%{version}-no_ipython.patch
a1ed0dd
# flake8 fails on testslide directory:
a1ed0dd
#   testslide/lib.py:19:5: F401 'testslide.mock_callable._CallableMock' imported but unused
a1ed0dd
#   testslide/lib.py:20:5: F401 'testslide.strict_mock.StrictMock' imported but unused
a1ed0dd
#   testslide/lib.py:20:5: F401 'testslide.strict_mock._DefaultMagic' imported but unused
a1ed0dd
# isort does not support --profile option
a1ed0dd
Patch4:         %{pypi_name}-%{version}-relax_lints.patch
a1ed0dd
%endif
2cf719e
# PR#297: Use get_typing_hints instead of __annotations__ to resolve types in Python 3.10
2cf719e
Patch5:         %{url}/commit/44990479e035a05fc265e7e88c8a14f5c01590d2.patch
0ac3050
BuildArch:      noarch
0ac3050
0ac3050
BuildRequires:  python3-devel
0ac3050
BuildRequires:  python3dist(setuptools) >= 38.6
0ac3050
BuildRequires:  sed
0ac3050
0ac3050
%if %{with docs}
0ac3050
# Docs requirements
0ac3050
BuildRequires:  make
0ac3050
BuildRequires:  ncurses
f1fb246
BuildRequires:  python3-ipython
0ac3050
BuildRequires:  python3dist(sphinx)
f1fb246
BuildRequires:  python3dist(sphinx-kr-theme)
0ac3050
%endif
0ac3050
0ac3050
%if %{with tests}
0ac3050
# Test requirements
f1fb246
BuildRequires:  black
0ac3050
BuildRequires:  make
0ac3050
BuildRequires:  python3dist(coverage)
f1fb246
BuildRequires:  python3dist(flake8)
f1fb246
BuildRequires:  python3dist(isort)
f1fb246
BuildRequires:  python3dist(mypy)
0ac3050
BuildRequires:  python3dist(psutil)
0ac3050
BuildRequires:  python3dist(pygments)
0ac3050
BuildRequires:  python3dist(typeguard)
0ac3050
%endif
0ac3050
0ac3050
%description
0ac3050
A test framework for Python that enable unit testing / TDD / BDD to be
0ac3050
productive and enjoyable.
0ac3050
0ac3050
Its well behaved mocks with thorough API validations catches bugs both
0ac3050
when code is first written or long in the future when it is changed.
0ac3050
0ac3050
The flexibility of using them with existing unittest.TestCase or TestSlide's
0ac3050
own test runner let users get its benefits without requiring refactoring
0ac3050
existing code.
0ac3050
0ac3050
%package -n     python3-%{pypi_name}
0ac3050
Summary:        %{summary}
f1fb246
%if 0%{?fedora} < 33 || 0%{?rhel} < 9
f1fb246
%py_provides    python3-%{pypi_name}
f1fb246
%endif
0ac3050
0ac3050
%description -n python3-%{pypi_name}
0ac3050
A test framework for Python that enable unit testing / TDD / BDD to be
0ac3050
productive and enjoyable.
0ac3050
0ac3050
Its well behaved mocks with thorough API validations catches bugs both
0ac3050
when code is first written or long in the future when it is changed.
0ac3050
0ac3050
The flexibility of using them with existing unittest.TestCase or TestSlide's
0ac3050
own test runner let users get its benefits without requiring refactoring
0ac3050
existing code.
0ac3050
f1fb246
%if %{with docs}
f1fb246
%package -n     python3-%{pypi_name}-docs
f1fb246
Summary:        Documentation for python3-%{pypi_name}
f1fb246
f1fb246
%description -n python3-%{pypi_name}-docs
f1fb246
The python3-%{pypi_name}-docs package contains documentation for
f1fb246
python3-%{pypi_name}.
f1fb246
%endif
0ac3050
0ac3050
%prep
f1fb246
%autosetup -n %{pypi_name}-%{version} -p1
0ac3050
# Remove bundled egg-info
0ac3050
rm -rf %{pypi_name}.egg-info
0ac3050
0ac3050
%build
0ac3050
%py3_build
0ac3050
%if %{with docs}
f1fb246
make docs V=1
0ac3050
%endif
0ac3050
0ac3050
%install
0ac3050
%py3_install
0ac3050
0ac3050
%if %{with tests}
0ac3050
%check
0ac3050
export PYTHONPATH=%{buildroot}%{python3_sitelib}
0ac3050
make tests V=1
0ac3050
%endif
0ac3050
0ac3050
%files -n python3-%{pypi_name}
0ac3050
%license LICENSE
0ac3050
%doc README.md
0ac3050
%{_bindir}/testslide
0ac3050
%{python3_sitelib}/testslide
0ac3050
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info
0ac3050
f1fb246
%if %{with docs}
f1fb246
%files -n python3-%{pypi_name}-docs
f1fb246
%doc docs/_build/html
f1fb246
%endif
f1fb246
0ac3050
%changelog
2cf719e
* Thu Apr 15 2021 Davide Cavalca <dcavalca@fedoraproject.org> - 2.6.4-4
2cf719e
- Backport PR#297 for Python 3.10 compatibility (#1944109)
2cf719e
fb26e50
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.4-3.1
fb26e50
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
fb26e50
a1ed0dd
* Thu Jan 14 2021 Michel Alexandre Salim <salimma@fedoraproject.org> - 2.6.4-2.1
a1ed0dd
- Fix documentation build and skip some lints on F32 and below
a1ed0dd
a1ed0dd
* Tue Jan  5 2021 Davide Cavalca <dcavalca@fedoraproject.org> - 2.6.4-2
261c359
- Backport PR#271, PR#272 and PR#273 to adjust requirements for EPEL 8
261c359
18f412d
* Sat Jan  2 2021 Davide Cavalca <dcavalca@fedoraproject.org> - 2.6.4-1
18f412d
- New upstream release
18f412d
d805ab8
* Wed Dec 30 2020 Davide Cavalca <dcavalca@fedoraproject.org> - 2.6.3-2
d805ab8
- Build for EPEL 8
d805ab8
19cb913
* Thu Nov 12 2020 Davide Cavalca <dcavalca@fedoraproject.org> - 2.6.3-1
19cb913
- New upstream release
19cb913
f1fb246
* Mon Nov  2 2020 Davide Cavalca <dcavalca@fedoraproject.org> - 2.6.1-3
f1fb246
- Backport PR#260, PR#261, PR#262
f1fb246
- Add py_provides for F32
f1fb246
- Build and package docs
f1fb246
- Run tests
f1fb246
0ac3050
* Tue Oct 27 2020 Davide Cavalca <dcavalca@fb.com> - 2.6.1-2
0ac3050
- Update BuildRequires
0ac3050
- Remove unneeded shebangs
0ac3050
- Drop unnecessary python_provide macro
0ac3050
0ac3050
* Tue Oct 27 2020 Davide Cavalca <dcavalca@fb.com> - 2.6.1-1
0ac3050
- Initial package
0ac3050
- Disable tests and docs for now