Skip to content

Commit

Permalink
common: drop support for rhel7 and rhel6
Browse files Browse the repository at this point in the history
  • Loading branch information
xsuchy committed Aug 3, 2024
1 parent 805550c commit 19ff52e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 67 deletions.
60 changes: 1 addition & 59 deletions common/python-copr-common.spec
Original file line number Diff line number Diff line change
@@ -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}
Expand All @@ -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,\
Expand All @@ -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
Expand All @@ -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
Expand Down
10 changes: 2 additions & 8 deletions common/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 19ff52e

Please sign in to comment.