From 03bb2c6a12721b2b890bcee9b289fb0e6248594f Mon Sep 17 00:00:00 2001
From: Ralph Bean <rbean@redhat.com>
Date: Jul 09 2019 16:30:43 +0000
Subject: [PATCH 1/7] Pull specfile from repo.


---

diff --git a/openshift/containers/jenkins-slave/Dockerfile b/openshift/containers/jenkins-slave/Dockerfile
index 0dd6509..9ea32d4 100644
--- a/openshift/containers/jenkins-slave/Dockerfile
+++ b/openshift/containers/jenkins-slave/Dockerfile
@@ -35,7 +35,8 @@ RUN dnf -y install 'dnf-command(builddep)' dnf-utils git mock-core-configs tar g
   && rm -rf "$TEMPDIR" \
   && dnf clean all
 
-COPY sync2jira.spec /usr/local/src/sync2jira/sync2jira.spec
+  # Pull down our spec file.
+RUN curl https://pagure.io/sync-to-jira/raw/develop/f/sync2jira.spec > /usr/local/src/sync2jira/sync2jira.spec
 
 # install build dependencies for sync2jira
 RUN cd /usr/local/src/sync2jira \

From 84a13500f0678a5cdbed3d4fbac7d840a6b8ac50 Mon Sep 17 00:00:00 2001
From: Ralph Bean <rbean@redhat.com>
Date: Jul 09 2019 16:30:43 +0000
Subject: [PATCH 2/7] requests is actually okay at any version.


---

diff --git a/requirements.txt b/requirements.txt
index 4ce4996..aade641 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
 jira
-requests==2.14.0
+requests
 fedmsg
 PyGithub
 urllib3
\ No newline at end of file

From 3f747e1a7718012d68a1a0126ae3456c5a91bafa Mon Sep 17 00:00:00 2001
From: Ralph Bean <rbean@redhat.com>
Date: Jul 09 2019 16:30:43 +0000
Subject: [PATCH 3/7] Remove python2 sub-package.  No longer needed.


---

diff --git a/sync2jira.spec b/sync2jira.spec
index 8ee2e6e..c990283 100644
--- a/sync2jira.spec
+++ b/sync2jira.spec
@@ -1,11 +1,3 @@
-%if 0%{?fedora}
-%global py2 2
-%global with_python3 1
-%else
-# On EL7 define %%{py2} as the empty string.
-%define py2 %{nil}
-%endif
-
 %{!?_licensedir: %global license %%doc}
 
 %global modname sync2jira
@@ -24,18 +16,6 @@ BuildArch:          noarch
 
 BuildRequires:      systemd
 
-BuildRequires:      python%{py2}-devel
-BuildRequires:      python%{py2}-setuptools
-BuildRequires:      python%{py2}-fedmsg-core
-BuildRequires:      python%{py2}-requests
-BuildRequires:      python%{py2}-nose
-BuildRequires:      python%{py2}-mock
-BuildRequires:      python%{py2}-arrow
-%if 0%{?fedora}
-BuildRequires:      python%{py2}-jira
-%endif
-
-%if 0%{?with_python3}
 BuildRequires:      python3-devel
 BuildRequires:      python3-setuptools
 BuildRequires:      python3-fedmsg-core
@@ -44,7 +24,6 @@ BuildRequires:      python3-nose
 BuildRequires:      python3-mock
 BuildRequires:      python3-jira
 BuildRequires:      python3-arrow
-%endif
 
 %description
 This is a process that listens to activity on upstream repos on pagure and
@@ -54,25 +33,6 @@ Configuration is in /etc/fedmsg.d/. You can maintain a mapping there that
 allows you to match one upstream repo (say, 'pungi' on pagure) to a downstream
 project/component pair in Jira (say, 'COMPOSE', and 'Pungi').
 
-%package -n python2-%{modname}
-Summary:            %{sum}
-%{?python_provide:%python_provide python2-%{modname}}
-
-Requires:           python%{py2}-requests
-Requires:           python%{py2}-fedmsg-core
-%if 0%{?fedora}
-Requires:           python%{py2}-jira
-%endif
-
-%description -n python2-%{modname}
-This is a process that listens to activity on upstream repos on pagure and
-github via fedmsg, and syncs new issues there to a Jira instance elsewhere.
-
-Configuration is in /etc/fedmsg.d/. You can maintain a mapping there that
-allows you to match one upstream repo (say, 'pungi' on pagure) to a downstream
-project/component pair in Jira (say, 'COMPOSE', and 'Pungi').
-
-%if 0%{?with_python3}
 %package -n python3-%{modname}
 Summary:            %{sum}
 %{?python_provide:%python_provide python3-%{modname}}
@@ -88,7 +48,6 @@ github via fedmsg, and syncs new issues there to a Jira instance elsewhere.
 Configuration is in /etc/fedmsg.d/. You can maintain a mapping there that
 allows you to match one upstream repo (say, 'pungi' on pagure) to a downstream
 project/component pair in Jira (say, 'COMPOSE', and 'Pungi').
-%endif
 
 %prep
 %setup -q -n %{modname}-%{upstream_version}
@@ -103,40 +62,23 @@ sed -i '/\/usr\/bin\/env/d' sync2jira/main.py
 rm -rf *.egg*
 
 %build
-%py2_build
-%if 0%{?with_python3}
 %py3_build
-%endif
 
 %install
-%py2_install
-%if 0%{?with_python3}
 %py3_install
-%endif
 
 %{__mkdir_p} %{buildroot}%{_unitdir}
 %{__install} -pm644 systemd/sync2jira.service \
     %{buildroot}%{_unitdir}/sync2jira.service
 
 %check
-%{__python2} setup.py test
-%if 0%{?with_python3}
 %{__python3} setup.py test
-%endif
-
-%files -n python2-%{modname}
-%doc README.rst
-%license LICENSE
-%{python2_sitelib}/%{modname}/
-%{python2_sitelib}/%{modname}-*.egg*
 
-%if 0%{?with_python3}
 %files -n python3-%{modname}
 %doc README.rst
 %license LICENSE
 %{python3_sitelib}/%{modname}/
 %{python3_sitelib}/%{modname}-*.egg*
-%endif
 
 # If built with py3, provide executables in py3 subpackage
 %{_bindir}/sync2jira

From 29b3ae6be6a700d4fe40c0afe2969c0a6c5f0044 Mon Sep 17 00:00:00 2001
From: Ralph Bean <rbean@redhat.com>
Date: Jul 09 2019 16:30:43 +0000
Subject: [PATCH 4/7] No need to test on python2 any more.


---

diff --git a/tox.ini b/tox.ini
index eff3480..84d1300 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,9 +1,9 @@
 [tox]
-envlist = {py27,py35},flake8
+envlist = {py37,py35},flake8
 
 [testenv]
 basepython =
-    py27: python2.7
+    py37: python3.7
     py35: python3.5
 deps =
     -r{toxinidir}/requirements.txt

From 5d3151841302f46759b85ada201733f177ce1e69 Mon Sep 17 00:00:00 2001
From: Ralph Bean <rbean@redhat.com>
Date: Jul 09 2019 16:30:43 +0000
Subject: [PATCH 5/7] Fix up dependencies in the specfile.


---

diff --git a/sync2jira.spec b/sync2jira.spec
index c990283..8f9415d 100644
--- a/sync2jira.spec
+++ b/sync2jira.spec
@@ -19,8 +19,9 @@ BuildRequires:      systemd
 BuildRequires:      python3-devel
 BuildRequires:      python3-setuptools
 BuildRequires:      python3-fedmsg-core
+BuildRequires:      python3-github3py
 BuildRequires:      python3-requests
-BuildRequires:      python3-nose
+BuildRequires:      python3-pytest
 BuildRequires:      python3-mock
 BuildRequires:      python3-jira
 BuildRequires:      python3-arrow
@@ -40,6 +41,7 @@ Summary:            %{sum}
 Requires:           python3-requests
 Requires:           python3-jira
 Requires:           python3-fedmsg-core
+Requires:           python3-github3py
 
 %description -n python3-%{modname}
 This is a process that listens to activity on upstream repos on pagure and

From 2cbc2a98ecd653a4d20f89e83f51d41dc32bb20c Mon Sep 17 00:00:00 2001
From: Ralph Bean <rbean@redhat.com>
Date: Jul 09 2019 16:30:43 +0000
Subject: [PATCH 6/7] Make sure tox is available in the slave.


---

diff --git a/openshift/containers/jenkins-slave/Dockerfile b/openshift/containers/jenkins-slave/Dockerfile
index 9ea32d4..b029b4d 100644
--- a/openshift/containers/jenkins-slave/Dockerfile
+++ b/openshift/containers/jenkins-slave/Dockerfile
@@ -16,7 +16,7 @@ ARG OPENSHIFT_CLIENTS_COMMIT=dd10d17
 RUN dnf -y install 'dnf-command(builddep)' dnf-utils git mock-core-configs tar gzip skopeo \
     wget postgresql make rpmdevtools rpmlint \
     python3-flake8 python3-pylint python3-pytest \
-    python3-nose \
+    python3-tox \
     python3-sphinx python3-sphinxcontrib-httpdomain \
   && mkdir -p /usr/local/src/sync2jira \
   && TEMPDIR=$(mktemp -d) \

From 273e4c35ae0745a36b3b55afce73103147d1e741 Mon Sep 17 00:00:00 2001
From: Ralph Bean <rbean@redhat.com>
Date: Jul 09 2019 16:30:43 +0000
Subject: [PATCH 7/7] Bring back nose as a dep.


---

diff --git a/openshift/containers/jenkins-slave/Dockerfile b/openshift/containers/jenkins-slave/Dockerfile
index b029b4d..f17eee3 100644
--- a/openshift/containers/jenkins-slave/Dockerfile
+++ b/openshift/containers/jenkins-slave/Dockerfile
@@ -16,6 +16,7 @@ ARG OPENSHIFT_CLIENTS_COMMIT=dd10d17
 RUN dnf -y install 'dnf-command(builddep)' dnf-utils git mock-core-configs tar gzip skopeo \
     wget postgresql make rpmdevtools rpmlint \
     python3-flake8 python3-pylint python3-pytest \
+    python3-nose \
     python3-tox \
     python3-sphinx python3-sphinxcontrib-httpdomain \
   && mkdir -p /usr/local/src/sync2jira \
diff --git a/sync2jira.spec b/sync2jira.spec
index 8f9415d..6e850f4 100644
--- a/sync2jira.spec
+++ b/sync2jira.spec
@@ -21,6 +21,7 @@ BuildRequires:      python3-setuptools
 BuildRequires:      python3-fedmsg-core
 BuildRequires:      python3-github3py
 BuildRequires:      python3-requests
+BuildRequires:      python3-nose
 BuildRequires:      python3-pytest
 BuildRequires:      python3-mock
 BuildRequires:      python3-jira

