From 5bdbf4564ef509555d14577fa65df2366454f83d458bca7e0f74cd85724089fd Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 12 Apr 2023 14:17:21 +0000 Subject: [PATCH 1/5] Update WIP OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-python-jenkins?expand=0&rev=32 --- python-jenkins-1.7.0.tar.gz | 3 --- python-jenkins-1.8.0.tar.gz | 3 +++ python-python-jenkins.spec | 11 ++++++----- 3 files changed, 9 insertions(+), 8 deletions(-) delete mode 100644 python-jenkins-1.7.0.tar.gz create mode 100644 python-jenkins-1.8.0.tar.gz diff --git a/python-jenkins-1.7.0.tar.gz b/python-jenkins-1.7.0.tar.gz deleted file mode 100644 index b8c5073..0000000 --- a/python-jenkins-1.7.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:deed8fa79d32769a615984a5dde5e01eda04914d3f4091bd9a23d30474695106 -size 61250 diff --git a/python-jenkins-1.8.0.tar.gz b/python-jenkins-1.8.0.tar.gz new file mode 100644 index 0000000..c2733bd --- /dev/null +++ b/python-jenkins-1.8.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0180a5463f68e2e0110f382b4248d2284bc68481db4a16fcbf61f4f55801c31f +size 64814 diff --git a/python-python-jenkins.spec b/python-python-jenkins.spec index a82d457..4b3bffd 100644 --- a/python-python-jenkins.spec +++ b/python-python-jenkins.spec @@ -1,7 +1,7 @@ # # spec file for package python-python-jenkins # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # Copyright (c) 2014 Thomas Bechtold # # All modifications and additions to the file contributed by third parties @@ -19,7 +19,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-python-jenkins -Version: 1.7.0 +Version: 1.8.0 Release: 0 Summary: Python bindings for the remote Jenkins API License: BSD-3-Clause @@ -31,16 +31,17 @@ Patch0: python-python-jenkins-no-mock.patch BuildRequires: %{python_module cmd2} BuildRequires: %{python_module multi_key_dict} BuildRequires: %{python_module pbr >= 0.8.2} +BuildRequires: %{python_module pip} BuildRequires: %{python_module requests-mock >= 1.4} BuildRequires: %{python_module requests} BuildRequires: %{python_module testscenarios} +BuildRequires: %{python_module wheel} BuildRequires: openssl-devel BuildRequires: pkgconfig BuildRequires: python-rpm-macros BuildRequires: pkgconfig(krb5-gssapi) Requires: python-multi_key_dict Requires: python-requests -Requires: python-setuptools Requires: python-six >= 1.3.0 Provides: python-jenkins = %{version} Obsoletes: python-jenkins < %{version} @@ -58,10 +59,10 @@ API. It currently supports management of: %autosetup -p1 -n python-jenkins-%{version} %build -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %check %pyunittest tests/*.py From a41675fb7f3b5055d132f65a4a668ff736902dcdb98f358f43de321ee3c12976 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 12 Apr 2023 15:19:20 +0000 Subject: [PATCH 2/5] - Add skip_failing_tests.patch - Add pkg_resources.patch (lp#2003556) to use packaging instead of obsolete version of pkg_resources. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-python-jenkins?expand=0&rev=33 --- pkg_resources.patch | 46 ++++ python-python-jenkins-no-mock.patch | 314 ++++++++++++++++++---------- python-python-jenkins.changes | 7 + python-python-jenkins.spec | 20 +- skip_failing_tests.patch | 40 ++++ 5 files changed, 314 insertions(+), 113 deletions(-) create mode 100644 pkg_resources.patch create mode 100644 skip_failing_tests.patch diff --git a/pkg_resources.patch b/pkg_resources.patch new file mode 100644 index 0000000..31118bb --- /dev/null +++ b/pkg_resources.patch @@ -0,0 +1,46 @@ +--- + jenkins/plugins.py | 5 +++-- + requirements.txt | 4 ++-- + 2 files changed, 5 insertions(+), 4 deletions(-) + +Index: python-jenkins-1.8.0/jenkins/plugins.py +=================================================================== +--- python-jenkins-1.8.0.orig/jenkins/plugins.py ++++ python-jenkins-1.8.0/jenkins/plugins.py +@@ -43,6 +43,7 @@ import operator + import re + + import pkg_resources ++import packaging.version + + + class Plugin(dict): +@@ -76,14 +77,14 @@ class PluginVersion(str): + '''Parse plugin version and store it for comparison.''' + + self._version = version +- self.parsed_version = pkg_resources.parse_version( ++ self.parsed_version = packaging.version.parse( + self.__convert_version(version)) + + def __convert_version(self, version): + return self._VERSION_RE.sub(r'\g<1>.preview', str(version)) + + def __compare(self, op, version): +- return op(self.parsed_version, pkg_resources.parse_version( ++ return op(self.parsed_version, packaging.version.parse( + self.__convert_version(version))) + + def __le__(self, version): +Index: python-jenkins-1.8.0/requirements.txt +=================================================================== +--- python-jenkins-1.8.0.orig/requirements.txt ++++ python-jenkins-1.8.0/requirements.txt +@@ -1,5 +1,5 @@ +-# Setuptools removed support for PEP 440 non-conforming versions +-setuptools<66 ++setuptools ++packaging + six>=1.3.0 + pbr>=0.8.2 + multi_key_dict diff --git a/python-python-jenkins-no-mock.patch b/python-python-jenkins-no-mock.patch index d70ffda..b158317 100644 --- a/python-python-jenkins-no-mock.patch +++ b/python-python-jenkins-no-mock.patch @@ -1,17 +1,79 @@ -diff -upr python-jenkins-1.7.0.orig/tests/base.py python-jenkins-1.7.0/tests/base.py ---- python-jenkins-1.7.0.orig/tests/base.py 2022-05-03 14:48:58.234141501 +0200 -+++ python-jenkins-1.7.0/tests/base.py 2022-05-03 14:48:58.242141551 +0200 -@@ -1,6 +1,6 @@ +--- + test-requirements.txt | 2 -- + tests/base.py | 7 ++----- + tests/helper.py | 2 +- + tests/jobs/test_assert.py | 2 +- + tests/jobs/test_build.py | 2 +- + tests/jobs/test_config.py | 2 +- + tests/jobs/test_copy.py | 2 +- + tests/jobs/test_count.py | 2 +- + tests/jobs/test_create.py | 2 +- + tests/jobs/test_debug.py | 2 +- + tests/jobs/test_delete.py | 2 +- + tests/jobs/test_disable.py | 2 +- + tests/jobs/test_enable.py | 2 +- + tests/jobs/test_get.py | 2 +- + tests/jobs/test_getall.py | 2 +- + tests/jobs/test_info.py | 2 +- + tests/jobs/test_name.py | 2 +- + tests/jobs/test_reconfig.py | 2 +- + tests/jobs/test_rename.py | 2 +- + tests/jobs/test_set_next_build_number.py | 2 +- + tests/test_build.py | 2 +- + tests/test_check_jenkinsfile_syntax.py | 2 +- + tests/test_credential.py | 2 +- + tests/test_info.py | 2 +- + tests/test_jenkins.py | 2 +- + tests/test_job_folder.py | 2 +- + tests/test_node.py | 2 +- + tests/test_plugins.py | 2 +- + tests/test_promotion.py | 2 +- + tests/test_queue.py | 2 +- + tests/test_quiet_down.py | 2 +- + tests/test_script.py | 2 +- + tests/test_version.py | 2 +- + tests/test_view.py | 2 +- + tests/test_whoami.py | 2 +- + 35 files changed, 35 insertions(+), 40 deletions(-) + +Index: python-jenkins-1.8.0/test-requirements.txt +=================================================================== +--- python-jenkins-1.8.0.orig/test-requirements.txt ++++ python-jenkins-1.8.0/test-requirements.txt +@@ -1,8 +1,6 @@ + cmd2!=0.8.3,<0.9.0;python_version<'3.0' # MIT + cmd2!=0.8.3;python_version>='3.0' # MIT + coverage>=3.6 +-mock +-unittest2 + python-subunit + requests-mock>=1.4.0 + requests-kerberos<=0.12.0;python_version<'3.6' +Index: python-jenkins-1.8.0/tests/base.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/base.py ++++ python-jenkins-1.8.0/tests/base.py +@@ -1,14 +1,11 @@ import sys -import mock +from unittest import mock ++import unittest from testscenarios import TestWithScenarios import jenkins -diff -upr python-jenkins-1.7.0.orig/tests/helper.py python-jenkins-1.7.0/tests/helper.py ---- python-jenkins-1.7.0.orig/tests/helper.py 2022-05-03 14:48:58.234141501 +0200 -+++ python-jenkins-1.7.0/tests/helper.py 2022-05-03 14:48:58.242141551 +0200 + +-if sys.version_info < (2, 7): +- import unittest2 as unittest +-else: +- import unittest + + + class JenkinsTestBase(TestWithScenarios, unittest.TestCase): +Index: python-jenkins-1.8.0/tests/helper.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/helper.py ++++ python-jenkins-1.8.0/tests/helper.py @@ -4,7 +4,7 @@ from multiprocessing import Process from multiprocessing import Queue import traceback @@ -21,9 +83,10 @@ diff -upr python-jenkins-1.7.0.orig/tests/helper.py python-jenkins-1.7.0/tests/h import requests from six.moves import socketserver -diff -upr python-jenkins-1.7.0.orig/tests/jobs/test_assert.py python-jenkins-1.7.0/tests/jobs/test_assert.py ---- python-jenkins-1.7.0.orig/tests/jobs/test_assert.py 2022-05-03 14:48:58.238141526 +0200 -+++ python-jenkins-1.7.0/tests/jobs/test_assert.py 2022-05-03 14:48:58.246141576 +0200 +Index: python-jenkins-1.8.0/tests/jobs/test_assert.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/jobs/test_assert.py ++++ python-jenkins-1.8.0/tests/jobs/test_assert.py @@ -1,5 +1,5 @@ import json -from mock import patch @@ -31,9 +94,10 @@ diff -upr python-jenkins-1.7.0.orig/tests/jobs/test_assert.py python-jenkins-1.7 import jenkins from tests.jobs.base import JenkinsJobsTestBase -diff -upr python-jenkins-1.7.0.orig/tests/jobs/test_build.py python-jenkins-1.7.0/tests/jobs/test_build.py ---- python-jenkins-1.7.0.orig/tests/jobs/test_build.py 2022-05-03 14:48:58.238141526 +0200 -+++ python-jenkins-1.7.0/tests/jobs/test_build.py 2022-05-03 14:48:58.246141576 +0200 +Index: python-jenkins-1.8.0/tests/jobs/test_build.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/jobs/test_build.py ++++ python-jenkins-1.8.0/tests/jobs/test_build.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from mock import patch @@ -41,18 +105,20 @@ diff -upr python-jenkins-1.7.0.orig/tests/jobs/test_build.py python-jenkins-1.7. import jenkins from six.moves.urllib.parse import quote -diff -upr python-jenkins-1.7.0.orig/tests/jobs/test_config.py python-jenkins-1.7.0/tests/jobs/test_config.py ---- python-jenkins-1.7.0.orig/tests/jobs/test_config.py 2022-05-03 14:48:58.238141526 +0200 -+++ python-jenkins-1.7.0/tests/jobs/test_config.py 2022-05-03 14:48:58.246141576 +0200 +Index: python-jenkins-1.8.0/tests/jobs/test_config.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/jobs/test_config.py ++++ python-jenkins-1.8.0/tests/jobs/test_config.py @@ -1,4 +1,4 @@ -from mock import patch +from unittest.mock import patch import jenkins from tests.jobs.base import JenkinsJobsTestBase -diff -upr python-jenkins-1.7.0.orig/tests/jobs/test_copy.py python-jenkins-1.7.0/tests/jobs/test_copy.py ---- python-jenkins-1.7.0.orig/tests/jobs/test_copy.py 2022-05-03 14:48:58.238141526 +0200 -+++ python-jenkins-1.7.0/tests/jobs/test_copy.py 2022-05-03 14:48:58.246141576 +0200 +Index: python-jenkins-1.8.0/tests/jobs/test_copy.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/jobs/test_copy.py ++++ python-jenkins-1.8.0/tests/jobs/test_copy.py @@ -1,5 +1,5 @@ import json -from mock import patch @@ -60,9 +126,10 @@ diff -upr python-jenkins-1.7.0.orig/tests/jobs/test_copy.py python-jenkins-1.7.0 import jenkins from tests.jobs.base import JenkinsJobsTestBase -diff -upr python-jenkins-1.7.0.orig/tests/jobs/test_count.py python-jenkins-1.7.0/tests/jobs/test_count.py ---- python-jenkins-1.7.0.orig/tests/jobs/test_count.py 2022-05-03 14:48:58.238141526 +0200 -+++ python-jenkins-1.7.0/tests/jobs/test_count.py 2022-05-03 14:48:58.246141576 +0200 +Index: python-jenkins-1.8.0/tests/jobs/test_count.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/jobs/test_count.py ++++ python-jenkins-1.8.0/tests/jobs/test_count.py @@ -1,5 +1,5 @@ import json -from mock import patch @@ -70,9 +137,10 @@ diff -upr python-jenkins-1.7.0.orig/tests/jobs/test_count.py python-jenkins-1.7. import jenkins from tests.jobs.base import JenkinsJobsTestBase -diff -upr python-jenkins-1.7.0.orig/tests/jobs/test_create.py python-jenkins-1.7.0/tests/jobs/test_create.py ---- python-jenkins-1.7.0.orig/tests/jobs/test_create.py 2022-05-03 14:48:58.238141526 +0200 -+++ python-jenkins-1.7.0/tests/jobs/test_create.py 2022-05-03 14:48:58.246141576 +0200 +Index: python-jenkins-1.8.0/tests/jobs/test_create.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/jobs/test_create.py ++++ python-jenkins-1.8.0/tests/jobs/test_create.py @@ -1,5 +1,5 @@ import json -from mock import patch @@ -80,9 +148,10 @@ diff -upr python-jenkins-1.7.0.orig/tests/jobs/test_create.py python-jenkins-1.7 import jenkins from tests.jobs.base import JenkinsJobsTestBase -diff -upr python-jenkins-1.7.0.orig/tests/jobs/test_debug.py python-jenkins-1.7.0/tests/jobs/test_debug.py ---- python-jenkins-1.7.0.orig/tests/jobs/test_debug.py 2022-05-03 14:48:58.238141526 +0200 -+++ python-jenkins-1.7.0/tests/jobs/test_debug.py 2022-05-03 14:48:58.246141576 +0200 +Index: python-jenkins-1.8.0/tests/jobs/test_debug.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/jobs/test_debug.py ++++ python-jenkins-1.8.0/tests/jobs/test_debug.py @@ -1,5 +1,5 @@ import json -from mock import patch @@ -90,9 +159,10 @@ diff -upr python-jenkins-1.7.0.orig/tests/jobs/test_debug.py python-jenkins-1.7. import jenkins from tests.jobs.base import JenkinsJobsTestBase -diff -upr python-jenkins-1.7.0.orig/tests/jobs/test_delete.py python-jenkins-1.7.0/tests/jobs/test_delete.py ---- python-jenkins-1.7.0.orig/tests/jobs/test_delete.py 2022-05-03 14:48:58.238141526 +0200 -+++ python-jenkins-1.7.0/tests/jobs/test_delete.py 2022-05-03 14:48:58.246141576 +0200 +Index: python-jenkins-1.8.0/tests/jobs/test_delete.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/jobs/test_delete.py ++++ python-jenkins-1.8.0/tests/jobs/test_delete.py @@ -1,5 +1,5 @@ import json -from mock import patch @@ -100,9 +170,10 @@ diff -upr python-jenkins-1.7.0.orig/tests/jobs/test_delete.py python-jenkins-1.7 import jenkins from tests.jobs.base import JenkinsJobsTestBase -diff -upr python-jenkins-1.7.0.orig/tests/jobs/test_disable.py python-jenkins-1.7.0/tests/jobs/test_disable.py ---- python-jenkins-1.7.0.orig/tests/jobs/test_disable.py 2022-05-03 14:48:58.238141526 +0200 -+++ python-jenkins-1.7.0/tests/jobs/test_disable.py 2022-05-03 14:48:58.246141576 +0200 +Index: python-jenkins-1.8.0/tests/jobs/test_disable.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/jobs/test_disable.py ++++ python-jenkins-1.8.0/tests/jobs/test_disable.py @@ -1,5 +1,5 @@ import json -from mock import patch @@ -110,9 +181,10 @@ diff -upr python-jenkins-1.7.0.orig/tests/jobs/test_disable.py python-jenkins-1. import jenkins from tests.jobs.base import JenkinsJobsTestBase -diff -upr python-jenkins-1.7.0.orig/tests/jobs/test_enable.py python-jenkins-1.7.0/tests/jobs/test_enable.py ---- python-jenkins-1.7.0.orig/tests/jobs/test_enable.py 2022-05-03 14:48:58.238141526 +0200 -+++ python-jenkins-1.7.0/tests/jobs/test_enable.py 2022-05-03 14:48:58.246141576 +0200 +Index: python-jenkins-1.8.0/tests/jobs/test_enable.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/jobs/test_enable.py ++++ python-jenkins-1.8.0/tests/jobs/test_enable.py @@ -1,5 +1,5 @@ import json -from mock import patch @@ -120,9 +192,21 @@ diff -upr python-jenkins-1.7.0.orig/tests/jobs/test_enable.py python-jenkins-1.7 import jenkins from tests.jobs.base import JenkinsJobsTestBase -diff -upr python-jenkins-1.7.0.orig/tests/jobs/test_getall.py python-jenkins-1.7.0/tests/jobs/test_getall.py ---- python-jenkins-1.7.0.orig/tests/jobs/test_getall.py 2022-05-03 14:48:58.238141526 +0200 -+++ python-jenkins-1.7.0/tests/jobs/test_getall.py 2022-05-03 14:48:58.246141576 +0200 +Index: python-jenkins-1.8.0/tests/jobs/test_get.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/jobs/test_get.py ++++ python-jenkins-1.8.0/tests/jobs/test_get.py +@@ -1,5 +1,5 @@ + import json +-from mock import patch ++from unittest.mock import patch + + import jenkins + from tests.helper import build_response_mock +Index: python-jenkins-1.8.0/tests/jobs/test_getall.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/jobs/test_getall.py ++++ python-jenkins-1.8.0/tests/jobs/test_getall.py @@ -1,5 +1,5 @@ import json -from mock import patch @@ -130,9 +214,10 @@ diff -upr python-jenkins-1.7.0.orig/tests/jobs/test_getall.py python-jenkins-1.7 import jenkins from tests.jobs.base import JenkinsGetJobsTestBase -diff -upr python-jenkins-1.7.0.orig/tests/jobs/test_get.py python-jenkins-1.7.0/tests/jobs/test_get.py ---- python-jenkins-1.7.0.orig/tests/jobs/test_get.py 2022-05-03 14:48:58.238141526 +0200 -+++ python-jenkins-1.7.0/tests/jobs/test_get.py 2022-05-03 14:48:58.246141576 +0200 +Index: python-jenkins-1.8.0/tests/jobs/test_info.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/jobs/test_info.py ++++ python-jenkins-1.8.0/tests/jobs/test_info.py @@ -1,5 +1,5 @@ import json -from mock import patch @@ -140,19 +225,10 @@ diff -upr python-jenkins-1.7.0.orig/tests/jobs/test_get.py python-jenkins-1.7.0/ import jenkins from tests.helper import build_response_mock -diff -upr python-jenkins-1.7.0.orig/tests/jobs/test_info.py python-jenkins-1.7.0/tests/jobs/test_info.py ---- python-jenkins-1.7.0.orig/tests/jobs/test_info.py 2022-05-03 14:48:58.238141526 +0200 -+++ python-jenkins-1.7.0/tests/jobs/test_info.py 2022-05-03 14:48:58.246141576 +0200 -@@ -1,5 +1,5 @@ - import json --from mock import patch -+from unittest.mock import patch - - import jenkins - from tests.helper import build_response_mock -diff -upr python-jenkins-1.7.0.orig/tests/jobs/test_name.py python-jenkins-1.7.0/tests/jobs/test_name.py ---- python-jenkins-1.7.0.orig/tests/jobs/test_name.py 2022-05-03 14:48:58.238141526 +0200 -+++ python-jenkins-1.7.0/tests/jobs/test_name.py 2022-05-03 14:48:58.246141576 +0200 +Index: python-jenkins-1.8.0/tests/jobs/test_name.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/jobs/test_name.py ++++ python-jenkins-1.8.0/tests/jobs/test_name.py @@ -1,5 +1,5 @@ import json -from mock import patch @@ -160,9 +236,10 @@ diff -upr python-jenkins-1.7.0.orig/tests/jobs/test_name.py python-jenkins-1.7.0 import jenkins from tests.jobs.base import JenkinsJobsTestBase -diff -upr python-jenkins-1.7.0.orig/tests/jobs/test_reconfig.py python-jenkins-1.7.0/tests/jobs/test_reconfig.py ---- python-jenkins-1.7.0.orig/tests/jobs/test_reconfig.py 2022-05-03 14:48:58.238141526 +0200 -+++ python-jenkins-1.7.0/tests/jobs/test_reconfig.py 2022-05-03 14:48:58.246141576 +0200 +Index: python-jenkins-1.8.0/tests/jobs/test_reconfig.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/jobs/test_reconfig.py ++++ python-jenkins-1.8.0/tests/jobs/test_reconfig.py @@ -1,5 +1,5 @@ import json -from mock import patch @@ -170,9 +247,10 @@ diff -upr python-jenkins-1.7.0.orig/tests/jobs/test_reconfig.py python-jenkins-1 import jenkins from tests.jobs.base import JenkinsJobsTestBase -diff -upr python-jenkins-1.7.0.orig/tests/jobs/test_rename.py python-jenkins-1.7.0/tests/jobs/test_rename.py ---- python-jenkins-1.7.0.orig/tests/jobs/test_rename.py 2022-05-03 14:48:58.238141526 +0200 -+++ python-jenkins-1.7.0/tests/jobs/test_rename.py 2022-05-03 14:48:58.246141576 +0200 +Index: python-jenkins-1.8.0/tests/jobs/test_rename.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/jobs/test_rename.py ++++ python-jenkins-1.8.0/tests/jobs/test_rename.py @@ -1,5 +1,5 @@ import json -from mock import patch @@ -180,18 +258,20 @@ diff -upr python-jenkins-1.7.0.orig/tests/jobs/test_rename.py python-jenkins-1.7 import jenkins from tests.jobs.base import JenkinsJobsTestBase -diff -upr python-jenkins-1.7.0.orig/tests/jobs/test_set_next_build_number.py python-jenkins-1.7.0/tests/jobs/test_set_next_build_number.py ---- python-jenkins-1.7.0.orig/tests/jobs/test_set_next_build_number.py 2022-05-03 14:48:58.238141526 +0200 -+++ python-jenkins-1.7.0/tests/jobs/test_set_next_build_number.py 2022-05-03 14:48:58.246141576 +0200 +Index: python-jenkins-1.8.0/tests/jobs/test_set_next_build_number.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/jobs/test_set_next_build_number.py ++++ python-jenkins-1.8.0/tests/jobs/test_set_next_build_number.py @@ -1,4 +1,4 @@ -from mock import patch +from unittest.mock import patch import jenkins from tests.jobs.base import JenkinsJobsTestBase -diff -upr python-jenkins-1.7.0.orig/tests/test_build.py python-jenkins-1.7.0/tests/test_build.py ---- python-jenkins-1.7.0.orig/tests/test_build.py 2022-05-03 14:48:58.234141501 +0200 -+++ python-jenkins-1.7.0/tests/test_build.py 2022-05-03 14:48:58.242141551 +0200 +Index: python-jenkins-1.8.0/tests/test_build.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/test_build.py ++++ python-jenkins-1.8.0/tests/test_build.py @@ -1,7 +1,7 @@ import json @@ -201,18 +281,20 @@ diff -upr python-jenkins-1.7.0.orig/tests/test_build.py python-jenkins-1.7.0/tes import jenkins from tests.base import JenkinsTestBase -diff -upr python-jenkins-1.7.0.orig/tests/test_check_jenkinsfile_syntax.py python-jenkins-1.7.0/tests/test_check_jenkinsfile_syntax.py ---- python-jenkins-1.7.0.orig/tests/test_check_jenkinsfile_syntax.py 2022-05-03 14:48:58.234141501 +0200 -+++ python-jenkins-1.7.0/tests/test_check_jenkinsfile_syntax.py 2022-05-03 14:48:58.246141576 +0200 +Index: python-jenkins-1.8.0/tests/test_check_jenkinsfile_syntax.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/test_check_jenkinsfile_syntax.py ++++ python-jenkins-1.8.0/tests/test_check_jenkinsfile_syntax.py @@ -1,4 +1,4 @@ -from mock import patch +from unittest.mock import patch from tests.base import JenkinsTestBase from tests.helper import build_response_mock -diff -upr python-jenkins-1.7.0.orig/tests/test_credential.py python-jenkins-1.7.0/tests/test_credential.py ---- python-jenkins-1.7.0.orig/tests/test_credential.py 2022-05-03 14:48:58.234141501 +0200 -+++ python-jenkins-1.7.0/tests/test_credential.py 2022-05-03 14:48:58.242141551 +0200 +Index: python-jenkins-1.8.0/tests/test_credential.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/test_credential.py ++++ python-jenkins-1.8.0/tests/test_credential.py @@ -1,5 +1,5 @@ import json -from mock import patch @@ -220,9 +302,10 @@ diff -upr python-jenkins-1.7.0.orig/tests/test_credential.py python-jenkins-1.7. import jenkins from tests.base import JenkinsTestBase -diff -upr python-jenkins-1.7.0.orig/tests/test_info.py python-jenkins-1.7.0/tests/test_info.py ---- python-jenkins-1.7.0.orig/tests/test_info.py 2022-05-03 14:48:58.238141526 +0200 -+++ python-jenkins-1.7.0/tests/test_info.py 2022-05-03 14:48:58.246141576 +0200 +Index: python-jenkins-1.8.0/tests/test_info.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/test_info.py ++++ python-jenkins-1.8.0/tests/test_info.py @@ -1,5 +1,5 @@ import json -from mock import patch @@ -230,9 +313,10 @@ diff -upr python-jenkins-1.7.0.orig/tests/test_info.py python-jenkins-1.7.0/test import jenkins from tests.base import JenkinsTestBase -diff -upr python-jenkins-1.7.0.orig/tests/test_jenkins.py python-jenkins-1.7.0/tests/test_jenkins.py ---- python-jenkins-1.7.0.orig/tests/test_jenkins.py 2022-05-03 14:48:58.234141501 +0200 -+++ python-jenkins-1.7.0/tests/test_jenkins.py 2022-05-03 14:48:58.246141576 +0200 +Index: python-jenkins-1.8.0/tests/test_jenkins.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/test_jenkins.py ++++ python-jenkins-1.8.0/tests/test_jenkins.py @@ -1,7 +1,7 @@ import json import socket @@ -242,18 +326,20 @@ diff -upr python-jenkins-1.7.0.orig/tests/test_jenkins.py python-jenkins-1.7.0/t import six from tests.base import JenkinsTestBase -diff -upr python-jenkins-1.7.0.orig/tests/test_job_folder.py python-jenkins-1.7.0/tests/test_job_folder.py ---- python-jenkins-1.7.0.orig/tests/test_job_folder.py 2022-05-03 14:48:58.234141501 +0200 -+++ python-jenkins-1.7.0/tests/test_job_folder.py 2022-05-03 14:48:58.242141551 +0200 +Index: python-jenkins-1.8.0/tests/test_job_folder.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/test_job_folder.py ++++ python-jenkins-1.8.0/tests/test_job_folder.py @@ -1,4 +1,4 @@ -from mock import patch +from unittest.mock import patch import jenkins from tests.base import JenkinsTestBase -diff -upr python-jenkins-1.7.0.orig/tests/test_node.py python-jenkins-1.7.0/tests/test_node.py ---- python-jenkins-1.7.0.orig/tests/test_node.py 2022-05-03 14:48:58.234141501 +0200 -+++ python-jenkins-1.7.0/tests/test_node.py 2022-05-03 14:48:58.242141551 +0200 +Index: python-jenkins-1.8.0/tests/test_node.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/test_node.py ++++ python-jenkins-1.8.0/tests/test_node.py @@ -1,5 +1,5 @@ import json -from mock import patch @@ -261,9 +347,10 @@ diff -upr python-jenkins-1.7.0.orig/tests/test_node.py python-jenkins-1.7.0/test import jenkins import requests_mock -diff -upr python-jenkins-1.7.0.orig/tests/test_plugins.py python-jenkins-1.7.0/tests/test_plugins.py ---- python-jenkins-1.7.0.orig/tests/test_plugins.py 2022-05-03 14:48:58.234141501 +0200 -+++ python-jenkins-1.7.0/tests/test_plugins.py 2022-05-03 14:48:58.242141551 +0200 +Index: python-jenkins-1.8.0/tests/test_plugins.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/test_plugins.py ++++ python-jenkins-1.8.0/tests/test_plugins.py @@ -32,7 +32,7 @@ @@ -273,9 +360,10 @@ diff -upr python-jenkins-1.7.0.orig/tests/test_plugins.py python-jenkins-1.7.0/t from testscenarios.scenarios import multiply_scenarios import jenkins -diff -upr python-jenkins-1.7.0.orig/tests/test_promotion.py python-jenkins-1.7.0/tests/test_promotion.py ---- python-jenkins-1.7.0.orig/tests/test_promotion.py 2022-05-03 14:48:58.234141501 +0200 -+++ python-jenkins-1.7.0/tests/test_promotion.py 2022-05-03 14:48:58.242141551 +0200 +Index: python-jenkins-1.8.0/tests/test_promotion.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/test_promotion.py ++++ python-jenkins-1.8.0/tests/test_promotion.py @@ -1,5 +1,5 @@ import json -from mock import patch @@ -283,9 +371,10 @@ diff -upr python-jenkins-1.7.0.orig/tests/test_promotion.py python-jenkins-1.7.0 import jenkins from tests.base import JenkinsTestBase -diff -upr python-jenkins-1.7.0.orig/tests/test_queue.py python-jenkins-1.7.0/tests/test_queue.py ---- python-jenkins-1.7.0.orig/tests/test_queue.py 2022-05-03 14:48:58.234141501 +0200 -+++ python-jenkins-1.7.0/tests/test_queue.py 2022-05-03 14:48:58.246141576 +0200 +Index: python-jenkins-1.8.0/tests/test_queue.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/test_queue.py ++++ python-jenkins-1.8.0/tests/test_queue.py @@ -1,5 +1,5 @@ import json -from mock import patch @@ -293,9 +382,10 @@ diff -upr python-jenkins-1.7.0.orig/tests/test_queue.py python-jenkins-1.7.0/tes import jenkins from tests.base import JenkinsTestBase -diff -upr python-jenkins-1.7.0.orig/tests/test_quiet_down.py python-jenkins-1.7.0/tests/test_quiet_down.py ---- python-jenkins-1.7.0.orig/tests/test_quiet_down.py 2022-05-03 14:48:58.238141526 +0200 -+++ python-jenkins-1.7.0/tests/test_quiet_down.py 2022-05-03 14:48:58.246141576 +0200 +Index: python-jenkins-1.8.0/tests/test_quiet_down.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/test_quiet_down.py ++++ python-jenkins-1.8.0/tests/test_quiet_down.py @@ -1,5 +1,5 @@ import json -from mock import patch @@ -303,27 +393,30 @@ diff -upr python-jenkins-1.7.0.orig/tests/test_quiet_down.py python-jenkins-1.7. import jenkins from tests.base import JenkinsTestBase -diff -upr python-jenkins-1.7.0.orig/tests/test_script.py python-jenkins-1.7.0/tests/test_script.py ---- python-jenkins-1.7.0.orig/tests/test_script.py 2022-05-03 14:48:58.234141501 +0200 -+++ python-jenkins-1.7.0/tests/test_script.py 2022-05-03 14:48:58.242141551 +0200 +Index: python-jenkins-1.8.0/tests/test_script.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/test_script.py ++++ python-jenkins-1.8.0/tests/test_script.py @@ -1,4 +1,4 @@ -from mock import patch +from unittest.mock import patch import jenkins from tests.base import JenkinsTestBase -diff -upr python-jenkins-1.7.0.orig/tests/test_version.py python-jenkins-1.7.0/tests/test_version.py ---- python-jenkins-1.7.0.orig/tests/test_version.py 2022-05-03 14:48:58.234141501 +0200 -+++ python-jenkins-1.7.0/tests/test_version.py 2022-05-03 14:48:58.246141576 +0200 +Index: python-jenkins-1.8.0/tests/test_version.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/test_version.py ++++ python-jenkins-1.8.0/tests/test_version.py @@ -1,4 +1,4 @@ -from mock import patch +from unittest.mock import patch import jenkins from tests.base import JenkinsTestBase -diff -upr python-jenkins-1.7.0.orig/tests/test_view.py python-jenkins-1.7.0/tests/test_view.py ---- python-jenkins-1.7.0.orig/tests/test_view.py 2022-05-03 14:48:58.238141526 +0200 -+++ python-jenkins-1.7.0/tests/test_view.py 2022-05-03 14:48:58.246141576 +0200 +Index: python-jenkins-1.8.0/tests/test_view.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/test_view.py ++++ python-jenkins-1.8.0/tests/test_view.py @@ -1,5 +1,5 @@ import json -from mock import patch @@ -331,9 +424,10 @@ diff -upr python-jenkins-1.7.0.orig/tests/test_view.py python-jenkins-1.7.0/test import jenkins from tests.base import JenkinsTestBase -diff -upr python-jenkins-1.7.0.orig/tests/test_whoami.py python-jenkins-1.7.0/tests/test_whoami.py ---- python-jenkins-1.7.0.orig/tests/test_whoami.py 2022-05-03 14:48:58.234141501 +0200 -+++ python-jenkins-1.7.0/tests/test_whoami.py 2022-05-03 14:48:58.242141551 +0200 +Index: python-jenkins-1.8.0/tests/test_whoami.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/test_whoami.py ++++ python-jenkins-1.8.0/tests/test_whoami.py @@ -1,5 +1,5 @@ import json -from mock import patch diff --git a/python-python-jenkins.changes b/python-python-jenkins.changes index 368d235..31dbe49 100644 --- a/python-python-jenkins.changes +++ b/python-python-jenkins.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Apr 12 15:02:56 UTC 2023 - Matej Cepl + +- Add skip_failing_tests.patch +- Add pkg_resources.patch (lp#2003556) to use packaging instead + of obsolete version of pkg_resources. + ------------------------------------------------------------------- Wed May 4 05:46:39 UTC 2022 - pgajdos@suse.com diff --git a/python-python-jenkins.spec b/python-python-jenkins.spec index 4b3bffd..688de50 100644 --- a/python-python-jenkins.spec +++ b/python-python-jenkins.spec @@ -17,7 +17,6 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-python-jenkins Version: 1.8.0 Release: 0 @@ -28,20 +27,31 @@ URL: https://opendev.org/jjb/python-jenkins Source: https://files.pythonhosted.org/packages/source/p/python-jenkins/python-jenkins-%{version}.tar.gz # https://bugs.launchpad.net/python-jenkins/+bug/1971524 Patch0: python-python-jenkins-no-mock.patch +# PATCH-FIX-UPSTREAM pkg_resources.patch lp#2003556 mcepl@suse.com +# Don't depend on the old version of setuptools, but use packaging +Patch1: pkg_resources.patch +# PATCH-FIX-OPENSUSE skip_failing_tests.patch bsc#[0-9]+ mcepl@suse.com +# skip failing tests (upstream just up-versioned setuptools and cannot be bothered) +Patch2: skip_failing_tests.patch BuildRequires: %{python_module cmd2} BuildRequires: %{python_module multi_key_dict} +BuildRequires: %{python_module packaging} BuildRequires: %{python_module pbr >= 0.8.2} BuildRequires: %{python_module pip} BuildRequires: %{python_module requests-mock >= 1.4} BuildRequires: %{python_module requests} BuildRequires: %{python_module testscenarios} BuildRequires: %{python_module wheel} +BuildRequires: fdupes BuildRequires: openssl-devel BuildRequires: pkgconfig BuildRequires: python-rpm-macros BuildRequires: pkgconfig(krb5-gssapi) Requires: python-multi_key_dict +Requires: python-packaging +Requires: python-pbr Requires: python-requests +Requires: python-setuptools Requires: python-six >= 1.3.0 Provides: python-jenkins = %{version} Obsoletes: python-jenkins < %{version} @@ -58,18 +68,22 @@ API. It currently supports management of: %prep %autosetup -p1 -n python-jenkins-%{version} +sed -i '1{\@^#!%{_bindir}/env python@d}' jenkins/__init__.py + %build %pyproject_wheel %install %pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} %check -%pyunittest tests/*.py +%pyunittest discover -v tests %files %{python_files} %license COPYING %doc README.rst -%{python_sitelib}/* +%{python_sitelib}/jenkins +%{python_sitelib}/python_jenkins-%{version}*-info %changelog diff --git a/skip_failing_tests.patch b/skip_failing_tests.patch new file mode 100644 index 0000000..4ae5d1e --- /dev/null +++ b/skip_failing_tests.patch @@ -0,0 +1,40 @@ +--- + tests/test_plugins.py | 4 ++++ + 1 file changed, 4 insertions(+) + +Index: python-jenkins-1.8.0/tests/test_plugins.py +=================================================================== +--- python-jenkins-1.8.0.orig/tests/test_plugins.py ++++ python-jenkins-1.8.0/tests/test_plugins.py +@@ -33,6 +33,7 @@ + + import json + from unittest.mock import patch ++from unittest import skip + from testscenarios.scenarios import multiply_scenarios + + import jenkins +@@ -282,6 +283,7 @@ class PluginsTestScenarios(JenkinsPlugin + self.addCleanup(patcher.stop) + self.jenkins_mock.return_value = json.dumps(plugin_info_json) + ++ @skip("Failing with modern setuptools") + def test_plugin_version_comparison(self): + """Verify that valid versions are ordinally correct. + +@@ -300,6 +302,7 @@ class PluginsTestScenarios(JenkinsPlugin + "when comparing versions!" + .format(v1, self.v2, self.op)) + ++ @skip("Failing with modern setuptools") + def test_plugin_version_object_comparison(self): + """Verify use of PluginVersion for comparison + +@@ -320,6 +323,7 @@ class PluginsTestScenarios(JenkinsPlugin + .format(v1, v2, self.op)) + + ++@skip("Failing with modern setuptools") + class PluginsTest(JenkinsPluginsBase): + + def test_plugin_equal(self): From fb1d68a048485cc3b1aa0a9cbebfd8abaefd074c6f9e18fd0a170db44bdb96d7 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Mon, 17 Apr 2023 05:04:51 +0000 Subject: [PATCH 3/5] - Update to 1.8.0: * Add retrieval of stages of artifacts * Switch links to opendev.org * Allow build number to be a string * Use fullname in get_job_info_regex - Add patch use-parts-of-legacy-version.patch: * Use underpining parts of LegacyVersion pre-removal. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-python-jenkins?expand=0&rev=34 --- pkg_resources.patch | 46 --------------- python-python-jenkins.changes | 12 ++-- python-python-jenkins.spec | 10 +--- skip_failing_tests.patch | 40 ------------- use-parts-of-legacy-version.patch | 97 +++++++++++++++++++++++++++++++ 5 files changed, 108 insertions(+), 97 deletions(-) delete mode 100644 pkg_resources.patch delete mode 100644 skip_failing_tests.patch create mode 100644 use-parts-of-legacy-version.patch diff --git a/pkg_resources.patch b/pkg_resources.patch deleted file mode 100644 index 31118bb..0000000 --- a/pkg_resources.patch +++ /dev/null @@ -1,46 +0,0 @@ ---- - jenkins/plugins.py | 5 +++-- - requirements.txt | 4 ++-- - 2 files changed, 5 insertions(+), 4 deletions(-) - -Index: python-jenkins-1.8.0/jenkins/plugins.py -=================================================================== ---- python-jenkins-1.8.0.orig/jenkins/plugins.py -+++ python-jenkins-1.8.0/jenkins/plugins.py -@@ -43,6 +43,7 @@ import operator - import re - - import pkg_resources -+import packaging.version - - - class Plugin(dict): -@@ -76,14 +77,14 @@ class PluginVersion(str): - '''Parse plugin version and store it for comparison.''' - - self._version = version -- self.parsed_version = pkg_resources.parse_version( -+ self.parsed_version = packaging.version.parse( - self.__convert_version(version)) - - def __convert_version(self, version): - return self._VERSION_RE.sub(r'\g<1>.preview', str(version)) - - def __compare(self, op, version): -- return op(self.parsed_version, pkg_resources.parse_version( -+ return op(self.parsed_version, packaging.version.parse( - self.__convert_version(version))) - - def __le__(self, version): -Index: python-jenkins-1.8.0/requirements.txt -=================================================================== ---- python-jenkins-1.8.0.orig/requirements.txt -+++ python-jenkins-1.8.0/requirements.txt -@@ -1,5 +1,5 @@ --# Setuptools removed support for PEP 440 non-conforming versions --setuptools<66 -+setuptools -+packaging - six>=1.3.0 - pbr>=0.8.2 - multi_key_dict diff --git a/python-python-jenkins.changes b/python-python-jenkins.changes index 31dbe49..0aad2aa 100644 --- a/python-python-jenkins.changes +++ b/python-python-jenkins.changes @@ -1,9 +1,13 @@ ------------------------------------------------------------------- -Wed Apr 12 15:02:56 UTC 2023 - Matej Cepl +Mon Apr 17 05:03:59 UTC 2023 - Steve Kowalik -- Add skip_failing_tests.patch -- Add pkg_resources.patch (lp#2003556) to use packaging instead - of obsolete version of pkg_resources. +- Update to 1.8.0: + * Add retrieval of stages of artifacts + * Switch links to opendev.org + * Allow build number to be a string + * Use fullname in get_job_info_regex +- Add patch use-parts-of-legacy-version.patch: + * Use underpining parts of LegacyVersion pre-removal. ------------------------------------------------------------------- Wed May 4 05:46:39 UTC 2022 - pgajdos@suse.com diff --git a/python-python-jenkins.spec b/python-python-jenkins.spec index 688de50..e11d625 100644 --- a/python-python-jenkins.spec +++ b/python-python-jenkins.spec @@ -22,17 +22,13 @@ Version: 1.8.0 Release: 0 Summary: Python bindings for the remote Jenkins API License: BSD-3-Clause -Group: Development/Languages/Python URL: https://opendev.org/jjb/python-jenkins Source: https://files.pythonhosted.org/packages/source/p/python-jenkins/python-jenkins-%{version}.tar.gz # https://bugs.launchpad.net/python-jenkins/+bug/1971524 Patch0: python-python-jenkins-no-mock.patch -# PATCH-FIX-UPSTREAM pkg_resources.patch lp#2003556 mcepl@suse.com -# Don't depend on the old version of setuptools, but use packaging -Patch1: pkg_resources.patch -# PATCH-FIX-OPENSUSE skip_failing_tests.patch bsc#[0-9]+ mcepl@suse.com -# skip failing tests (upstream just up-versioned setuptools and cannot be bothered) -Patch2: skip_failing_tests.patch +# PATCH-FIX-OPENSUSE Upstream are arguing about version parsing, use the +# underlying parts of LegacyVersion from packaging pre-removal +Patch1: use-parts-of-legacy-version.patch BuildRequires: %{python_module cmd2} BuildRequires: %{python_module multi_key_dict} BuildRequires: %{python_module packaging} diff --git a/skip_failing_tests.patch b/skip_failing_tests.patch deleted file mode 100644 index 4ae5d1e..0000000 --- a/skip_failing_tests.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- - tests/test_plugins.py | 4 ++++ - 1 file changed, 4 insertions(+) - -Index: python-jenkins-1.8.0/tests/test_plugins.py -=================================================================== ---- python-jenkins-1.8.0.orig/tests/test_plugins.py -+++ python-jenkins-1.8.0/tests/test_plugins.py -@@ -33,6 +33,7 @@ - - import json - from unittest.mock import patch -+from unittest import skip - from testscenarios.scenarios import multiply_scenarios - - import jenkins -@@ -282,6 +283,7 @@ class PluginsTestScenarios(JenkinsPlugin - self.addCleanup(patcher.stop) - self.jenkins_mock.return_value = json.dumps(plugin_info_json) - -+ @skip("Failing with modern setuptools") - def test_plugin_version_comparison(self): - """Verify that valid versions are ordinally correct. - -@@ -300,6 +302,7 @@ class PluginsTestScenarios(JenkinsPlugin - "when comparing versions!" - .format(v1, self.v2, self.op)) - -+ @skip("Failing with modern setuptools") - def test_plugin_version_object_comparison(self): - """Verify use of PluginVersion for comparison - -@@ -320,6 +323,7 @@ class PluginsTestScenarios(JenkinsPlugin - .format(v1, v2, self.op)) - - -+@skip("Failing with modern setuptools") - class PluginsTest(JenkinsPluginsBase): - - def test_plugin_equal(self): diff --git a/use-parts-of-legacy-version.patch b/use-parts-of-legacy-version.patch new file mode 100644 index 0000000..b36d607 --- /dev/null +++ b/use-parts-of-legacy-version.patch @@ -0,0 +1,97 @@ +Index: python-jenkins-1.8.0/jenkins/plugins.py +=================================================================== +--- python-jenkins-1.8.0.orig/jenkins/plugins.py ++++ python-jenkins-1.8.0/jenkins/plugins.py +@@ -41,8 +41,7 @@ + + import operator + import re +- +-import pkg_resources ++from typing import Iterator, Tuple + + + class Plugin(dict): +@@ -67,6 +66,63 @@ class Plugin(dict): + super(Plugin, self).__setitem__(key, value) + + ++# Portion of code from packaging module, dual licensed under the terms of ++# the Apache License, Version 2.0, and the BSD License. ++_legacy_version_component_re = re.compile(r"(\d+ | [a-z]+ | \.| -)", re.VERBOSE) ++ ++_legacy_version_replacement_map = { ++ "pre": "c", ++ "preview": "c", ++ "-": "final-", ++ "rc": "c", ++ "dev": "@", ++} ++ ++ ++def _parse_version_parts(s: str) -> Iterator[str]: ++ for part in _legacy_version_component_re.split(s): ++ part = _legacy_version_replacement_map.get(part, part) ++ ++ if not part or part == ".": ++ continue ++ ++ if part[:1] in "0123456789": ++ # pad for numeric comparison ++ yield part.zfill(8) ++ else: ++ yield "*" + part ++ ++ # ensure that alpha/beta/candidate are before final ++ yield "*final" ++ ++ ++def _legacy_cmpkey(version: str) -> Tuple[int, Tuple[str, ...]]: ++ ++ # We hardcode an epoch of -1 here. A PEP 440 version can only have a epoch ++ # greater than or equal to 0. This will effectively put the LegacyVersion, ++ # which uses the defacto standard originally implemented by setuptools, ++ # as before all PEP 440 versions. ++ epoch = -1 ++ ++ # This scheme is taken from pkg_resources.parse_version setuptools prior to ++ # it's adoption of the packaging library. ++ parts: List[str] = [] ++ for part in _parse_version_parts(version.lower()): ++ if part.startswith("*"): ++ # remove "-" before a prerelease tag ++ if part < "*final": ++ while parts and parts[-1] == "*final-": ++ parts.pop() ++ ++ # remove trailing zeros from each series of numeric parts ++ while parts and parts[-1] == "00000000": ++ parts.pop() ++ ++ parts.append(part) ++ ++ return epoch, tuple(parts) ++ ++ + class PluginVersion(str): + '''Class providing comparison capabilities for plugin versions.''' + +@@ -76,15 +132,14 @@ class PluginVersion(str): + '''Parse plugin version and store it for comparison.''' + + self._version = version +- self.parsed_version = pkg_resources.parse_version( +- self.__convert_version(version)) ++ self.parsed_version = _legacy_cmpkey(self.__convert_version(version)) + + def __convert_version(self, version): + return self._VERSION_RE.sub(r'\g<1>.preview', str(version)) + + def __compare(self, op, version): +- return op(self.parsed_version, pkg_resources.parse_version( +- self.__convert_version(version))) ++ return op(self.parsed_version, ++ _legacy_cmpkey(self.__convert_version(version))) + + def __le__(self, version): + return self.__compare(operator.le, version) From 4665139ca83bc1745be3b315e3375c5733d16f2bd9969d0d9984ba413e59ec89 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Mon, 17 Apr 2023 08:08:35 +0000 Subject: [PATCH 4/5] Clean up BuildRequires/Requires OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-python-jenkins?expand=0&rev=35 --- python-python-jenkins.changes | 2 +- python-python-jenkins.spec | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/python-python-jenkins.changes b/python-python-jenkins.changes index 0aad2aa..3f0bb4c 100644 --- a/python-python-jenkins.changes +++ b/python-python-jenkins.changes @@ -1,5 +1,5 @@ ------------------------------------------------------------------- -Mon Apr 17 05:03:59 UTC 2023 - Steve Kowalik +Mon Apr 17 08:05:56 UTC 2023 - Steve Kowalik - Update to 1.8.0: * Add retrieval of stages of artifacts diff --git a/python-python-jenkins.spec b/python-python-jenkins.spec index e11d625..9d0b39d 100644 --- a/python-python-jenkins.spec +++ b/python-python-jenkins.spec @@ -31,7 +31,6 @@ Patch0: python-python-jenkins-no-mock.patch Patch1: use-parts-of-legacy-version.patch BuildRequires: %{python_module cmd2} BuildRequires: %{python_module multi_key_dict} -BuildRequires: %{python_module packaging} BuildRequires: %{python_module pbr >= 0.8.2} BuildRequires: %{python_module pip} BuildRequires: %{python_module requests-mock >= 1.4} @@ -44,10 +43,8 @@ BuildRequires: pkgconfig BuildRequires: python-rpm-macros BuildRequires: pkgconfig(krb5-gssapi) Requires: python-multi_key_dict -Requires: python-packaging Requires: python-pbr Requires: python-requests -Requires: python-setuptools Requires: python-six >= 1.3.0 Provides: python-jenkins = %{version} Obsoletes: python-jenkins < %{version} From a9b7b31b4c75a0f1b572828558e3ce85e28897a59a635fec5b3301b7884e9003 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Mon, 17 Apr 2023 08:15:17 +0000 Subject: [PATCH 5/5] Update patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-python-jenkins?expand=0&rev=36 --- use-parts-of-legacy-version.patch | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/use-parts-of-legacy-version.patch b/use-parts-of-legacy-version.patch index b36d607..cb885be 100644 --- a/use-parts-of-legacy-version.patch +++ b/use-parts-of-legacy-version.patch @@ -95,3 +95,13 @@ Index: python-jenkins-1.8.0/jenkins/plugins.py def __le__(self, version): return self.__compare(operator.le, version) +Index: python-jenkins-1.8.0/requirements.txt +=================================================================== +--- python-jenkins-1.8.0.orig/requirements.txt ++++ python-jenkins-1.8.0/requirements.txt +@@ -1,5 +1,3 @@ +-# Setuptools removed support for PEP 440 non-conforming versions +-setuptools<66 + six>=1.3.0 + pbr>=0.8.2 + multi_key_dict