# what it's called on pypi %global srcname pytest-env # what it's imported as %global modname pytest_env # name of egg info directory %global eggname pytest_env # package name fragment %global pkgname pytest-env %global commit afb13a0e908f649b69273f299262ac12f1b71113 %{?commit:%global shortcommit %(c=%{commit}; echo ${c:0:7})} %if %{defined rhel} || (%{defined fedora} && 0%{?fedora} < 32) %bcond_without python2 %endif %bcond_without python3 Name: python-%{srcname} Version: 0.6.2 Release: 2%{?dist} Summary: pytest plugin used to set environment variables License: MIT URL: https://github.com/MobileDynasty/pytest-env Source0: https://files.pythonhosted.org/packages/source/p/%{srcname}/%{srcname}-%{version}.tar.gz Source11: %{url}/raw/%{commit}/README.md Source12: %{url}/raw/%{commit}/LICENSE BuildArch: noarch %global _description \ This is a py.test plugin that enables you to set environment variables in the pytest.ini file. %description %{_description} %if %{with python2} %package -n python2-%{srcname} Summary: Pytest plugin for coverage reporting BuildRequires: python2-devel BuildRequires: python2-setuptools BuildRequires: %{py2_dist pytest} %{?python_provide:%python_provide python2-%{srcname}} %description -n python2-%{srcname} %{_description} %endif %if %{with python3} %package -n python3-%{srcname} Summary: Pytest plugin for coverage reporting BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: %{py3_dist pytest} %{?python_provide:%python_provide python3-%{srcname}} %description -n python3-%{srcname} %{_description} %endif %prep %autosetup -n %{srcname}-%{version} cp %{SOURCE11} %{SOURCE12} ./ %build %if %{with python2} %py2_build %endif %if %{with python3} %py3_build %endif %install %if %{with python2} %py2_install %endif %if %{with python3} %py3_install %endif %check %if %{with python2} PATH=%{buildroot}%{_bindir}:${PATH} \ PYTHONPATH=%{buildroot}%{python2_sitelib} \ %{__python2} setup.py test %endif %if %{with python3} PATH=%{buildroot}%{_bindir}:${PATH} \ PYTHONPATH=%{buildroot}%{python3_sitelib} \ %{__python3} setup.py test %endif %if %{with python2} %files -n python2-%{srcname} %license LICENSE %doc README.md %{python2_sitelib}/pytest_env %{python2_sitelib}/pytest_env-%{version}*.egg-info %endif %if %{with python3} %files -n python3-%{srcname} %license LICENSE %doc README.md %{python3_sitelib}/pytest_env %{python3_sitelib}/pytest_env-%{version}*.egg-info %endif %changelog * Fri Dec 06 2019 gasinvein - 0.6.2-2 - Make python2 and python3 builds conditional