diff --git a/common/python-copr-common.spec b/common/python-copr-common.spec index a14df3b92..281ae0974 100644 --- a/common/python-copr-common.spec +++ b/common/python-copr-common.spec @@ -1,20 +1,5 @@ %global srcname copr-common -%if 0%{?rhel} && 0%{?rhel} <= 6 -%{!?_licensedir:%global license %%doc} -%global _pkgdocdir %{_docdir}/%{name}-%{version} -%endif - -%if 0%{?fedora} || 0%{?rhel} > 7 || 0%{?openEuler} -%global with_python3 1 -%global __python %_bindir/python3 -%endif - -%if 0%{?fedora} && 0%{?fedora} < 28 || 0%{?rhel} && 0%{?rhel} <= 7 -%global with_python2 1 -%global __python %_bindir/python2 -%endif - Name: python-copr-common Version: 0.25 Release: 1%{?dist} @@ -30,22 +15,10 @@ Source0: %name-%version.tar.gz BuildArch: noarch -%if %{with python2} -BuildRequires: python2-devel -BuildRequires: python-setuptools -BuildRequires: python-pytest -BuildRequires: python-mock -BuildRequires: python-requests -BuildRequires: python-six -%endif - -%if %{with python3} BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pytest BuildRequires: python3-requests -BuildRequires: python3-six -%endif %global _description\ COPR is lightweight build system. It allows you to create new project in WebUI,\ @@ -58,20 +31,10 @@ useful for developers only.\ %description %_description -%if %{with python2} -%package -n python2-%{srcname} -Summary: %{summary} -%{?python_provide:%python_provide python2-%{srcname}} -%description -n python2-%{srcname} %_description -%endif - - -%if %{with python3} %package -n python3-%{srcname} Summary: %{summary} %{?python_provide:%python_provide python3-%{srcname}} %description -n python3-%{srcname} %_description -%endif %prep @@ -81,41 +44,20 @@ grep '"%version"' setup.py %build -%if %{with python3} version="%version" %py3_build -%endif - -%if %{with python2} -version="%version" %py2_build -%endif %install -%if %{with python3} version=%version %py3_install -%endif - -%if %{with python2} -version=%version %py2_install -%endif - %check -%{__python} -m pytest -vv tests +%{_bindir}/python3 -m pytest -vv tests -%if %{with python3} %files -n python3-%{srcname} %license LICENSE %{python3_sitelib}/* -%endif - -%if %{with python2} -%files -n python2-%{srcname} -%license LICENSE -%{python2_sitelib}/* -%endif %changelog diff --git a/common/tests/__init__.py b/common/tests/__init__.py index 921b9b945..de1c6c28e 100644 --- a/common/tests/__init__.py +++ b/common/tests/__init__.py @@ -1,8 +1,2 @@ -import six - -if six.PY3: - from unittest import mock - from unittest.mock import MagicMock -else: - import mock - from mock import MagicMock +from unittest import mock +from unittest.mock import MagicMock