commit 75e685c181748d0532e4528a181e4d8aed94d1bd
Author: Sérgio M. Basto <sergio(a)serjux.com>
Date: Wed Sep 16 23:41:33 2020 +0100
Fix (#5756) and python3 -m nose
d0ec0eb608024ecd6df60b1c567fd552d7e7e41d.patch | 68 +++++++++++++
rfpkg-test.patch | 128 +++++++++++++++++++++++++
rfpkg.spec | 22 +++--
3 files changed, 210 insertions(+), 8 deletions(-)
---
diff --git a/d0ec0eb608024ecd6df60b1c567fd552d7e7e41d.patch
b/d0ec0eb608024ecd6df60b1c567fd552d7e7e41d.patch
new file mode 100644
index 0000000..63edf53
--- /dev/null
+++ b/d0ec0eb608024ecd6df60b1c567fd552d7e7e41d.patch
@@ -0,0 +1,68 @@
+From d0ec0eb608024ecd6df60b1c567fd552d7e7e41d Mon Sep 17 00:00:00 2001
+From: Leigh Scott <leigh123linux(a)gmail.com>
+Date: Wed, 16 Sep 2020 01:33:57 +0100
+Subject: [PATCH] Try to address 'Commands' object has no attribute
+ 'read_koji_config'
+
+---
+ rfpkg/__init__.py | 46 +++++++---------------------------------------
+ 1 file changed, 7 insertions(+), 39 deletions(-)
+
+diff --git a/rfpkg/__init__.py b/rfpkg/__init__.py
+index 8517f72..2191d13 100644
+--- a/rfpkg/__init__.py
++++ b/rfpkg/__init__.py
+@@ -333,46 +333,14 @@ def update(self, template='bodhi.template', bugs=[]):
+ self._run_command(cmd, shell=True)
+
+ def load_kojisession(self, anon=False):
+- """Initiate a koji session.
+-
+- The koji session can be logged in or anonymous
+- """
+- koji_config = self.read_koji_config()
+-
+- # Expand out the directory options
+- for name in ('cert', 'ca', 'serverca'):
+- path = koji_config[name]
+- if path:
+- koji_config[name] = os.path.expanduser(path)
+-
+- # save the weburl and topurl for later use as well
+- self._kojiweburl = koji_config['weburl']
+- self._topurl = koji_config['topurl']
+-
+- self.log.debug('Initiating a %s session to %s',
+- os.path.basename(self.build_client),
koji_config['server'])
+-
+- # Build session options used to create instance of ClientSession
+- session_opts = koji.grab_session_options(koji_config)
+-
+ try:
+- session = koji.ClientSession(koji_config['server'], session_opts)
+- except Exception:
+- raise rpkgError('Could not initiate %s session' %
os.path.basename(self.build_client))
+- else:
+- if anon:
+- self._anon_kojisession = session
+- else:
+- self._kojisession = session
+-
+- if not anon:
+- try:
+- self.login_koji_session(koji_config, self._kojisession)
+- except pyrpkg.rpkgAuthError:
+- self.log.info("You might want to run rpmfusion-packager-setup or
rpmfusion-cert -n to "
+- "regenerate SSL certificate. For more info see
"
+-
"https://rpmfusion.org/Contributors#If_SSL_certificate_expired")
+- raise
++ return super(Commands, self).load_kojisession(anon)
++ except pyrpkg.rpkgAuthError:
++ self.log.info("You might want to run rpmfusion-packager-setup "
++ "or rpmfusion-cert -n to regenerate SSL certificate.
"
++ "For more info see
https://rpmfusion.org/Contributors"
++ "#If_SSL_certificate_expired")
++ raise
+
+
+ def _get_bodhi_version():
diff --git a/rfpkg-test.patch b/rfpkg-test.patch
new file mode 100644
index 0000000..5601f4d
--- /dev/null
+++ b/rfpkg-test.patch
@@ -0,0 +1,128 @@
+diff --git a/setup.cfg b/setup.cfg
+index d246701..a38d7e6 100644
+--- a/setup.cfg
++++ b/setup.cfg
+@@ -1,8 +1,17 @@
++[aliases]
++test = pytest
++
+ [sdist]
+-formats=bztar
++formats = bztar
++
++[tool:pytest]
++cover-package = rfpkg
++addopts = --cov=rfpkg
++testpaths = test
++
++[flake8]
++max-line-length = 100
+
+-[nosetests]
+-verbosity=2
+-detailed-errors=1
+-with-coverage=1
+-cover-package=rfpkg
++[egg_info]
++tag_build =
++tag_date = 0
+diff --git a/setup.py b/setup.py
+index c100f67..2fb1726 100755
+--- a/setup.py
++++ b/setup.py
+@@ -3,7 +3,7 @@
+ import os
+ import sys
+
+-from setuptools import setup, find_packages
++from setuptools import find_packages, setup
+
+ try:
+ from subprocess import getstatusoutput
+@@ -55,7 +55,6 @@ setup(
+
+ install_requires=install_requires,
+ tests_require=tests_require,
+- test_suite='nose.collector',
+
+ entry_points={
+ 'console_scripts': [
+@@ -75,5 +74,7 @@ setup(
+ 'Programming Language :: Python :: 3',
+ 'Programming Language :: Python :: 3.5',
+ 'Programming Language :: Python :: 3.6',
++ 'Programming Language :: Python :: 3.7',
++ 'Programming Language :: Python :: 3.8',
+ ],
+ )
+diff --git a/test/test_retire.py b/test/test_retire.py
+index 9de9f13..5296c1d 100644
+--- a/test/test_retire.py
++++ b/test/test_retire.py
+@@ -4,13 +4,13 @@ import os
+ import shutil
+ import unittest
+ import mock
+-import ConfigParser
++from six.moves import configparser
+ import tempfile
+ import subprocess
++import rfpkgdb2client
+
+ from rfpkg.cli import rfpkgClient
+
+-
+ TEST_CONFIG = os.path.join(os.path.dirname(__file__), 'rfpkg-test.conf')
+
+
+@@ -47,12 +47,13 @@ class RetireTestCase(unittest.TestCase):
+
+ def _get_latest_commit(self):
+ proc = subprocess.Popen(['git', 'log', '-n',
'1', '--pretty=%s'],
+- cwd=self.tmpdir, stdout=subprocess.PIPE)
++ cwd=self.tmpdir, stdout=subprocess.PIPE,
++ universal_newlines=True)
+ out, err = proc.communicate()
+ return out.strip()
+
+ def _fake_client(self, args):
+- config = ConfigParser.SafeConfigParser()
++ config = configparser.SafeConfigParser()
+ config.read(TEST_CONFIG)
+ with mock.patch('sys.argv', new=args):
+ client = rfpkgClient(config)
+@@ -71,7 +72,7 @@ class RetireTestCase(unittest.TestCase):
+ 'rfpkg.spec')))
+ self.assertEqual(self._get_latest_commit(), reason)
+
+- @mock.patch('pkgdb2client.PkgDB')
++ @mock.patch('rfpkgdb2client.PkgDB')
+ def test_retire_with_namespace(self, PkgDB):
+ self._setup_repo('ssh://git@pkgs.example.com/rpms/rfpkg')
+ args = ['rfpkg', '--release=master', 'retire', 'my
reason']
+@@ -85,7 +86,7 @@ class RetireTestCase(unittest.TestCase):
+ [mock.call('rfpkg', 'master',
namespace='rpms')])
+
+ @mock.patch('rpmfusion_cert.read_user_cert')
+- @mock.patch('pkgdb2client.PkgDB')
++ @mock.patch('rfpkgdb2client.PkgDB')
+ def test_retire_without_namespace(self, PkgDB, read_user_cert):
+ self._setup_repo('ssh://git@pkgs.example.com/rfpkg')
+ args = ['rfpkg', '--release=master', 'retire', 'my
reason']
+diff --git a/tests-requirements.txt b/tests-requirements.txt
+index 1cc4eb4..cca4322 100644
+--- a/tests-requirements.txt
++++ b/tests-requirements.txt
+@@ -1,5 +1,8 @@
+-mock == 1.0.1
+-nose == 1.3.7
+-nose-cov
++mock >= 1.0.1
++coverage<5.0.0
++cccolutils
++gitpython
+ freezegun
+-PyYAML
++rpm
++pytest
++pytest-cov
diff --git a/rfpkg.spec b/rfpkg.spec
index a6fd754..41a393f 100644
--- a/rfpkg.spec
+++ b/rfpkg.spec
@@ -5,13 +5,15 @@
Name: rfpkg
Version: 1.26.3
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: RPM Fusion utility for working with dist-git
License: GPLv2+
Group: Applications/System
URL:
https://github.com/rpmfusion-infra/rfpkg
Source0: %url/archive/v%{version}/%{name}-%{version}.tar.gz
Patch0: %url/commit/be33cce92923328b613e4245bfb28f2c10c93f35.patch
+Patch1: %url/commit/d0ec0eb608024ecd6df60b1c567fd552d7e7e41d.patch
+Patch2: rfpkg-test.patch
BuildArch: noarch
@@ -31,7 +33,6 @@ Requires: koji
Requires: redhat-rpm-config
%if %{with python2}
-
BuildRequires: python2
BuildRequires: python2-rpm-macros
BuildRequires: python2-setuptools
@@ -51,19 +52,21 @@ Requires: rpmfusion-packager >= 0.6.1
Requires: packagedb-cli > 2.2
%else
-
-BuildRequires: python3
-BuildRequires: python3-rpm-macros
-BuildRequires: python3-setuptools
+BuildRequires: python3-devel
+BuildRequires: python3-rpkg
+BuildRequires: python3-distro
# We br these things for man page generation due to imports
BuildRequires: python3-rpmfusion-cert
BuildRequires: rfpkgdb-cli
-BuildRequires: python3-rpkg
# For testing
BuildRequires: python3-mock
BuildRequires: python3-nose
+BuildRequires: python3-setuptools
+#BuildRequires: python3-bugzilla
+#BuildRequires: python3-freezegun
+#BuildRequires: python3-bodhi-client
Requires: python3-rpkg
Requires: redhat-rpm-config
@@ -114,7 +117,7 @@ nosetests
%if %{with python2}
#{__python2} -m nose
%else
-#{__python3} -m nose
+%{__python3} -m nose
%endif
%endif
@@ -138,6 +141,9 @@ nosetests
%changelog
+* Wed Sep 16 2020 Sérgio Basto <sergio(a)serjux.com> - 1.26.3-4
+- Fix (#5756) and python3 -m nose
+
* Sat May 30 2020 Leigh Scott <leigh123linux(a)gmail.com> - 1.26.3-3
- Rebuild for python-3.9