Blame SPECS/python3.11-pluggy.spec

24686c
%global __python3 /usr/bin/python3.11
24686c
%global python3_pkgversion 3.11
24686c
24686c
%global pypi_name pluggy
24686c
24686c
# Turn the tests off when bootstrapping Python, because pytest requires pluggy
24686c
%bcond_without tests
24686c
24686c
Name:           python%{python3_pkgversion}-pluggy
24686c
Version:        1.0.0
24686c
Release:        2%{?dist}
24686c
Summary:        The plugin manager stripped of pytest specific details
24686c
24686c
License:        MIT
24686c
URL:            https://github.com/pytest-dev/pluggy
24686c
Source0:        %{pypi_source}
24686c
24686c
24686c
BuildArch:      noarch
24686c
24686c
BuildRequires:  python%{python3_pkgversion}-devel
24686c
BuildRequires:  python%{python3_pkgversion}-rpm-macros
24686c
BuildRequires:  python%{python3_pkgversion}-setuptools
24686c
%if %{with tests}
24686c
BuildRequires:  python%{python3_pkgversion}-pytest
24686c
%endif
24686c
24686c
%description
24686c
The plugin manager stripped of pytest specific details.
24686c
24686c
24686c
%prep
24686c
%autosetup -p1 -n %{pypi_name}-%{version}
24686c
24686c
# remove setuptools_scm dependency since we don't have it in RHEL
24686c
sed -i '/setuptools-scm/d' pyproject.toml
24686c
sed -i '/setup_requires =/d' setup.cfg
24686c
sed -i '/setuptools-scm/d' setup.cfg
24686c
24686c
# since setuptools_scm is not available we need to sed out it's usage from setup.py and set the correct version
24686c
sed -i 's/use_scm_version={"write_to": "src\/pluggy\/_version.py"}/version="%{version}"/g' setup.py
24686c
24686c
24686c
%build
24686c
%py3_build
24686c
24686c
24686c
%install
24686c
%py3_install
24686c
24686c
%check
24686c
%if %{with tests}
24686c
# TODO investigate test_load_setuptools_instantiation failure
24686c
PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} -m pytest testing -k "not test_load_setuptools_instantiation"
24686c
%endif
24686c
export PYTHONPATH=%{buildroot}%{python3_sitelib}
24686c
test "$(%{python3} -c 'import pluggy; print(pluggy.__version__)')" == "%{version}"
24686c
24686c
24686c
%files
24686c
%{python3_sitelib}/%{pypi_name}/
24686c
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info/
24686c
%doc README.rst
24686c
%license LICENSE
24686c
24686c
24686c
%changelog
24686c
* Wed Feb 01 2023 Charalampos Stratakis <cstratak@redhat.com> - 1.0.0-2
24686c
- Enable tests
24686c
24686c
* Wed Oct 19 2022 Charalampos Stratakis <cstratak@redhat.com> - 1.0.0-1
24686c
- Initial package
24686c
- Fedora contributions by:
24686c
      Alfredo Moralejo <amoralej@redhat.com>
24686c
      Karsten Hopp <karsten@redhat.com>
24686c
      Matthias Runge <mrunge@redhat.com>
24686c
      Miro Hrončok <miro@hroncok.cz>
24686c
      Patrik Kopkan <pkopkan@redhat.com>
24686c
      Peter Robinson <pbrobinson@fedoraproject.org>
24686c
      Thomas Moschny <thm@fedoraproject.org>
24686c
      Tomáš Hrnčiar <thrnciar@redhat.com>
24686c
      Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>