forked from pool/python-python-jenkins
- Update to 1.8.2:
* Fix compatibility with setuptools >= 66 * get_build_artifact_as_bytes to support non-json files * Handle 'all' view name when requested 'All' * WrappedSession: Fix URL to requests issue 3829 * support urllib3 newer DEFAULT_TIMEOUT * Use multiprocess to avoid pickle errors in tox on macos - Dropped patch use-parts-of-legacy-version.patch: * Merged upstream. - Refreshed patch python-python-jenkins-no-mock.patch: * It was submitted upstream. - Add patch remove-six.patch: * Remove usage of six. - Remove pin against urllib3. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-python-jenkins?expand=0&rev=40
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0180a5463f68e2e0110f382b4248d2284bc68481db4a16fcbf61f4f55801c31f
|
||||
size 64814
|
3
python-jenkins-1.8.2.tar.gz
Normal file
3
python-jenkins-1.8.2.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:56e7dabb0607bdb8e1d6fc6d2d4301abedbed9165da2b206facbd3071cb6eecb
|
||||
size 66548
|
@@ -1,92 +1,62 @@
|
||||
---
|
||||
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(-)
|
||||
From c37936698341e1bbbec2b9b62dfc64ddc51f3dfd Mon Sep 17 00:00:00 2001
|
||||
From: Steve Kowalik <steven@wedontsleep.org>
|
||||
Date: Wed, 25 Jun 2025 16:02:31 +1000
|
||||
Subject: [PATCH] Stop using external mock module
|
||||
|
||||
Index: python-jenkins-1.8.0/test-requirements.txt
|
||||
Now that support for Python 2 has been dropped, we can switch to the
|
||||
built-in unittest.mock module and drop one more external test
|
||||
dependency.
|
||||
|
||||
Change-Id: Ie6e3b2c4047d00509053769fd5b49a1e4464e951
|
||||
---
|
||||
test-requirements.txt | 1 -
|
||||
tests/jobs/test_assert.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_job_folder.py | 2 +-
|
||||
tests/test_node.py | 2 +-
|
||||
tests/test_plugins.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 +-
|
||||
30 files changed, 29 insertions(+), 30 deletions(-)
|
||||
|
||||
Index: python-jenkins-1.8.2/test-requirements.txt
|
||||
===================================================================
|
||||
--- python-jenkins-1.8.0.orig/test-requirements.txt
|
||||
+++ python-jenkins-1.8.0/test-requirements.txt
|
||||
@@ -1,8 +1,6 @@
|
||||
--- python-jenkins-1.8.2.orig/test-requirements.txt
|
||||
+++ python-jenkins-1.8.2/test-requirements.txt
|
||||
@@ -1,7 +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
|
||||
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
|
||||
requests-mock>=1.11.0
|
||||
Index: python-jenkins-1.8.2/tests/jobs/test_assert.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
|
||||
|
||||
-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
|
||||
|
||||
-from mock import Mock
|
||||
+from unittest.mock import Mock
|
||||
import requests
|
||||
from six.moves import socketserver
|
||||
|
||||
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
|
||||
--- python-jenkins-1.8.2.orig/tests/jobs/test_assert.py
|
||||
+++ python-jenkins-1.8.2/tests/jobs/test_assert.py
|
||||
@@ -1,5 +1,5 @@
|
||||
import json
|
||||
-from mock import patch
|
||||
@@ -94,31 +64,20 @@ Index: python-jenkins-1.8.0/tests/jobs/test_assert.py
|
||||
|
||||
import jenkins
|
||||
from tests.jobs.base import JenkinsJobsTestBase
|
||||
Index: python-jenkins-1.8.0/tests/jobs/test_build.py
|
||||
Index: python-jenkins-1.8.2/tests/jobs/test_config.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
|
||||
+from unittest.mock import patch
|
||||
|
||||
import jenkins
|
||||
from six.moves.urllib.parse import quote
|
||||
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
|
||||
--- python-jenkins-1.8.2.orig/tests/jobs/test_config.py
|
||||
+++ python-jenkins-1.8.2/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
|
||||
Index: python-jenkins-1.8.0/tests/jobs/test_copy.py
|
||||
Index: python-jenkins-1.8.2/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
|
||||
--- python-jenkins-1.8.2.orig/tests/jobs/test_copy.py
|
||||
+++ python-jenkins-1.8.2/tests/jobs/test_copy.py
|
||||
@@ -1,5 +1,5 @@
|
||||
import json
|
||||
-from mock import patch
|
||||
@@ -126,10 +85,10 @@ Index: python-jenkins-1.8.0/tests/jobs/test_copy.py
|
||||
|
||||
import jenkins
|
||||
from tests.jobs.base import JenkinsJobsTestBase
|
||||
Index: python-jenkins-1.8.0/tests/jobs/test_count.py
|
||||
Index: python-jenkins-1.8.2/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
|
||||
--- python-jenkins-1.8.2.orig/tests/jobs/test_count.py
|
||||
+++ python-jenkins-1.8.2/tests/jobs/test_count.py
|
||||
@@ -1,5 +1,5 @@
|
||||
import json
|
||||
-from mock import patch
|
||||
@@ -137,10 +96,10 @@ Index: python-jenkins-1.8.0/tests/jobs/test_count.py
|
||||
|
||||
import jenkins
|
||||
from tests.jobs.base import JenkinsJobsTestBase
|
||||
Index: python-jenkins-1.8.0/tests/jobs/test_create.py
|
||||
Index: python-jenkins-1.8.2/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
|
||||
--- python-jenkins-1.8.2.orig/tests/jobs/test_create.py
|
||||
+++ python-jenkins-1.8.2/tests/jobs/test_create.py
|
||||
@@ -1,5 +1,5 @@
|
||||
import json
|
||||
-from mock import patch
|
||||
@@ -148,10 +107,10 @@ Index: python-jenkins-1.8.0/tests/jobs/test_create.py
|
||||
|
||||
import jenkins
|
||||
from tests.jobs.base import JenkinsJobsTestBase
|
||||
Index: python-jenkins-1.8.0/tests/jobs/test_debug.py
|
||||
Index: python-jenkins-1.8.2/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
|
||||
--- python-jenkins-1.8.2.orig/tests/jobs/test_debug.py
|
||||
+++ python-jenkins-1.8.2/tests/jobs/test_debug.py
|
||||
@@ -1,5 +1,5 @@
|
||||
import json
|
||||
-from mock import patch
|
||||
@@ -159,10 +118,10 @@ Index: python-jenkins-1.8.0/tests/jobs/test_debug.py
|
||||
|
||||
import jenkins
|
||||
from tests.jobs.base import JenkinsJobsTestBase
|
||||
Index: python-jenkins-1.8.0/tests/jobs/test_delete.py
|
||||
Index: python-jenkins-1.8.2/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
|
||||
--- python-jenkins-1.8.2.orig/tests/jobs/test_delete.py
|
||||
+++ python-jenkins-1.8.2/tests/jobs/test_delete.py
|
||||
@@ -1,5 +1,5 @@
|
||||
import json
|
||||
-from mock import patch
|
||||
@@ -170,10 +129,10 @@ Index: python-jenkins-1.8.0/tests/jobs/test_delete.py
|
||||
|
||||
import jenkins
|
||||
from tests.jobs.base import JenkinsJobsTestBase
|
||||
Index: python-jenkins-1.8.0/tests/jobs/test_disable.py
|
||||
Index: python-jenkins-1.8.2/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
|
||||
--- python-jenkins-1.8.2.orig/tests/jobs/test_disable.py
|
||||
+++ python-jenkins-1.8.2/tests/jobs/test_disable.py
|
||||
@@ -1,5 +1,5 @@
|
||||
import json
|
||||
-from mock import patch
|
||||
@@ -181,10 +140,10 @@ Index: python-jenkins-1.8.0/tests/jobs/test_disable.py
|
||||
|
||||
import jenkins
|
||||
from tests.jobs.base import JenkinsJobsTestBase
|
||||
Index: python-jenkins-1.8.0/tests/jobs/test_enable.py
|
||||
Index: python-jenkins-1.8.2/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
|
||||
--- python-jenkins-1.8.2.orig/tests/jobs/test_enable.py
|
||||
+++ python-jenkins-1.8.2/tests/jobs/test_enable.py
|
||||
@@ -1,5 +1,5 @@
|
||||
import json
|
||||
-from mock import patch
|
||||
@@ -192,10 +151,10 @@ Index: python-jenkins-1.8.0/tests/jobs/test_enable.py
|
||||
|
||||
import jenkins
|
||||
from tests.jobs.base import JenkinsJobsTestBase
|
||||
Index: python-jenkins-1.8.0/tests/jobs/test_get.py
|
||||
Index: python-jenkins-1.8.2/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
|
||||
--- python-jenkins-1.8.2.orig/tests/jobs/test_get.py
|
||||
+++ python-jenkins-1.8.2/tests/jobs/test_get.py
|
||||
@@ -1,5 +1,5 @@
|
||||
import json
|
||||
-from mock import patch
|
||||
@@ -203,10 +162,10 @@ Index: python-jenkins-1.8.0/tests/jobs/test_get.py
|
||||
|
||||
import jenkins
|
||||
from tests.helper import build_response_mock
|
||||
Index: python-jenkins-1.8.0/tests/jobs/test_getall.py
|
||||
Index: python-jenkins-1.8.2/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
|
||||
--- python-jenkins-1.8.2.orig/tests/jobs/test_getall.py
|
||||
+++ python-jenkins-1.8.2/tests/jobs/test_getall.py
|
||||
@@ -1,5 +1,5 @@
|
||||
import json
|
||||
-from mock import patch
|
||||
@@ -214,10 +173,10 @@ Index: python-jenkins-1.8.0/tests/jobs/test_getall.py
|
||||
|
||||
import jenkins
|
||||
from tests.jobs.base import JenkinsGetJobsTestBase
|
||||
Index: python-jenkins-1.8.0/tests/jobs/test_info.py
|
||||
Index: python-jenkins-1.8.2/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
|
||||
--- python-jenkins-1.8.2.orig/tests/jobs/test_info.py
|
||||
+++ python-jenkins-1.8.2/tests/jobs/test_info.py
|
||||
@@ -1,5 +1,5 @@
|
||||
import json
|
||||
-from mock import patch
|
||||
@@ -225,10 +184,10 @@ Index: python-jenkins-1.8.0/tests/jobs/test_info.py
|
||||
|
||||
import jenkins
|
||||
from tests.helper import build_response_mock
|
||||
Index: python-jenkins-1.8.0/tests/jobs/test_name.py
|
||||
Index: python-jenkins-1.8.2/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
|
||||
--- python-jenkins-1.8.2.orig/tests/jobs/test_name.py
|
||||
+++ python-jenkins-1.8.2/tests/jobs/test_name.py
|
||||
@@ -1,5 +1,5 @@
|
||||
import json
|
||||
-from mock import patch
|
||||
@@ -236,10 +195,10 @@ Index: python-jenkins-1.8.0/tests/jobs/test_name.py
|
||||
|
||||
import jenkins
|
||||
from tests.jobs.base import JenkinsJobsTestBase
|
||||
Index: python-jenkins-1.8.0/tests/jobs/test_reconfig.py
|
||||
Index: python-jenkins-1.8.2/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
|
||||
--- python-jenkins-1.8.2.orig/tests/jobs/test_reconfig.py
|
||||
+++ python-jenkins-1.8.2/tests/jobs/test_reconfig.py
|
||||
@@ -1,5 +1,5 @@
|
||||
import json
|
||||
-from mock import patch
|
||||
@@ -247,10 +206,10 @@ Index: python-jenkins-1.8.0/tests/jobs/test_reconfig.py
|
||||
|
||||
import jenkins
|
||||
from tests.jobs.base import JenkinsJobsTestBase
|
||||
Index: python-jenkins-1.8.0/tests/jobs/test_rename.py
|
||||
Index: python-jenkins-1.8.2/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
|
||||
--- python-jenkins-1.8.2.orig/tests/jobs/test_rename.py
|
||||
+++ python-jenkins-1.8.2/tests/jobs/test_rename.py
|
||||
@@ -1,5 +1,5 @@
|
||||
import json
|
||||
-from mock import patch
|
||||
@@ -258,43 +217,43 @@ Index: python-jenkins-1.8.0/tests/jobs/test_rename.py
|
||||
|
||||
import jenkins
|
||||
from tests.jobs.base import JenkinsJobsTestBase
|
||||
Index: python-jenkins-1.8.0/tests/jobs/test_set_next_build_number.py
|
||||
Index: python-jenkins-1.8.2/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
|
||||
--- python-jenkins-1.8.2.orig/tests/jobs/test_set_next_build_number.py
|
||||
+++ python-jenkins-1.8.2/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
|
||||
Index: python-jenkins-1.8.0/tests/test_build.py
|
||||
Index: python-jenkins-1.8.2/tests/test_build.py
|
||||
===================================================================
|
||||
--- python-jenkins-1.8.0.orig/tests/test_build.py
|
||||
+++ python-jenkins-1.8.0/tests/test_build.py
|
||||
--- python-jenkins-1.8.2.orig/tests/test_build.py
|
||||
+++ python-jenkins-1.8.2/tests/test_build.py
|
||||
@@ -1,7 +1,7 @@
|
||||
import json
|
||||
|
||||
import collections
|
||||
-from mock import patch
|
||||
+from unittest.mock import patch
|
||||
-from mock import patch, Mock
|
||||
+from unittest.mock import patch, Mock
|
||||
|
||||
import jenkins
|
||||
from tests.base import JenkinsTestBase
|
||||
Index: python-jenkins-1.8.0/tests/test_check_jenkinsfile_syntax.py
|
||||
Index: python-jenkins-1.8.2/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
|
||||
--- python-jenkins-1.8.2.orig/tests/test_check_jenkinsfile_syntax.py
|
||||
+++ python-jenkins-1.8.2/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
|
||||
Index: python-jenkins-1.8.0/tests/test_credential.py
|
||||
Index: python-jenkins-1.8.2/tests/test_credential.py
|
||||
===================================================================
|
||||
--- python-jenkins-1.8.0.orig/tests/test_credential.py
|
||||
+++ python-jenkins-1.8.0/tests/test_credential.py
|
||||
--- python-jenkins-1.8.2.orig/tests/test_credential.py
|
||||
+++ python-jenkins-1.8.2/tests/test_credential.py
|
||||
@@ -1,5 +1,5 @@
|
||||
import json
|
||||
-from mock import patch
|
||||
@@ -302,10 +261,10 @@ Index: python-jenkins-1.8.0/tests/test_credential.py
|
||||
|
||||
import jenkins
|
||||
from tests.base import JenkinsTestBase
|
||||
Index: python-jenkins-1.8.0/tests/test_info.py
|
||||
Index: python-jenkins-1.8.2/tests/test_info.py
|
||||
===================================================================
|
||||
--- python-jenkins-1.8.0.orig/tests/test_info.py
|
||||
+++ python-jenkins-1.8.0/tests/test_info.py
|
||||
--- python-jenkins-1.8.2.orig/tests/test_info.py
|
||||
+++ python-jenkins-1.8.2/tests/test_info.py
|
||||
@@ -1,5 +1,5 @@
|
||||
import json
|
||||
-from mock import patch
|
||||
@@ -313,33 +272,20 @@ Index: python-jenkins-1.8.0/tests/test_info.py
|
||||
|
||||
import jenkins
|
||||
from tests.base import JenkinsTestBase
|
||||
Index: python-jenkins-1.8.0/tests/test_jenkins.py
|
||||
Index: python-jenkins-1.8.2/tests/test_job_folder.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
|
||||
|
||||
-from mock import patch
|
||||
+from unittest.mock import patch
|
||||
import six
|
||||
|
||||
from tests.base import JenkinsTestBase
|
||||
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
|
||||
--- python-jenkins-1.8.2.orig/tests/test_job_folder.py
|
||||
+++ python-jenkins-1.8.2/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
|
||||
Index: python-jenkins-1.8.0/tests/test_node.py
|
||||
Index: python-jenkins-1.8.2/tests/test_node.py
|
||||
===================================================================
|
||||
--- python-jenkins-1.8.0.orig/tests/test_node.py
|
||||
+++ python-jenkins-1.8.0/tests/test_node.py
|
||||
--- python-jenkins-1.8.2.orig/tests/test_node.py
|
||||
+++ python-jenkins-1.8.2/tests/test_node.py
|
||||
@@ -1,5 +1,5 @@
|
||||
import json
|
||||
-from mock import patch
|
||||
@@ -347,10 +293,10 @@ Index: python-jenkins-1.8.0/tests/test_node.py
|
||||
|
||||
import jenkins
|
||||
import requests_mock
|
||||
Index: python-jenkins-1.8.0/tests/test_plugins.py
|
||||
Index: python-jenkins-1.8.2/tests/test_plugins.py
|
||||
===================================================================
|
||||
--- python-jenkins-1.8.0.orig/tests/test_plugins.py
|
||||
+++ python-jenkins-1.8.0/tests/test_plugins.py
|
||||
--- python-jenkins-1.8.2.orig/tests/test_plugins.py
|
||||
+++ python-jenkins-1.8.2/tests/test_plugins.py
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
|
||||
@@ -360,10 +306,10 @@ Index: python-jenkins-1.8.0/tests/test_plugins.py
|
||||
from testscenarios.scenarios import multiply_scenarios
|
||||
|
||||
import jenkins
|
||||
Index: python-jenkins-1.8.0/tests/test_promotion.py
|
||||
Index: python-jenkins-1.8.2/tests/test_queue.py
|
||||
===================================================================
|
||||
--- python-jenkins-1.8.0.orig/tests/test_promotion.py
|
||||
+++ python-jenkins-1.8.0/tests/test_promotion.py
|
||||
--- python-jenkins-1.8.2.orig/tests/test_queue.py
|
||||
+++ python-jenkins-1.8.2/tests/test_queue.py
|
||||
@@ -1,5 +1,5 @@
|
||||
import json
|
||||
-from mock import patch
|
||||
@@ -371,10 +317,10 @@ Index: python-jenkins-1.8.0/tests/test_promotion.py
|
||||
|
||||
import jenkins
|
||||
from tests.base import JenkinsTestBase
|
||||
Index: python-jenkins-1.8.0/tests/test_queue.py
|
||||
Index: python-jenkins-1.8.2/tests/test_quiet_down.py
|
||||
===================================================================
|
||||
--- python-jenkins-1.8.0.orig/tests/test_queue.py
|
||||
+++ python-jenkins-1.8.0/tests/test_queue.py
|
||||
--- python-jenkins-1.8.2.orig/tests/test_quiet_down.py
|
||||
+++ python-jenkins-1.8.2/tests/test_quiet_down.py
|
||||
@@ -1,5 +1,5 @@
|
||||
import json
|
||||
-from mock import patch
|
||||
@@ -382,41 +328,30 @@ Index: python-jenkins-1.8.0/tests/test_queue.py
|
||||
|
||||
import jenkins
|
||||
from tests.base import JenkinsTestBase
|
||||
Index: python-jenkins-1.8.0/tests/test_quiet_down.py
|
||||
Index: python-jenkins-1.8.2/tests/test_script.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
|
||||
+from unittest.mock import patch
|
||||
|
||||
import jenkins
|
||||
from tests.base import JenkinsTestBase
|
||||
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
|
||||
--- python-jenkins-1.8.2.orig/tests/test_script.py
|
||||
+++ python-jenkins-1.8.2/tests/test_script.py
|
||||
@@ -1,4 +1,4 @@
|
||||
-from mock import patch
|
||||
+from unittest.mock import patch
|
||||
|
||||
import jenkins
|
||||
from tests.base import JenkinsTestBase
|
||||
Index: python-jenkins-1.8.0/tests/test_version.py
|
||||
Index: python-jenkins-1.8.2/tests/test_version.py
|
||||
===================================================================
|
||||
--- python-jenkins-1.8.0.orig/tests/test_version.py
|
||||
+++ python-jenkins-1.8.0/tests/test_version.py
|
||||
--- python-jenkins-1.8.2.orig/tests/test_version.py
|
||||
+++ python-jenkins-1.8.2/tests/test_version.py
|
||||
@@ -1,4 +1,4 @@
|
||||
-from mock import patch
|
||||
+from unittest.mock import patch
|
||||
|
||||
import jenkins
|
||||
from tests.base import JenkinsTestBase
|
||||
Index: python-jenkins-1.8.0/tests/test_view.py
|
||||
Index: python-jenkins-1.8.2/tests/test_view.py
|
||||
===================================================================
|
||||
--- python-jenkins-1.8.0.orig/tests/test_view.py
|
||||
+++ python-jenkins-1.8.0/tests/test_view.py
|
||||
--- python-jenkins-1.8.2.orig/tests/test_view.py
|
||||
+++ python-jenkins-1.8.2/tests/test_view.py
|
||||
@@ -1,5 +1,5 @@
|
||||
import json
|
||||
-from mock import patch
|
||||
@@ -424,10 +359,10 @@ Index: python-jenkins-1.8.0/tests/test_view.py
|
||||
|
||||
import jenkins
|
||||
from tests.base import JenkinsTestBase
|
||||
Index: python-jenkins-1.8.0/tests/test_whoami.py
|
||||
Index: python-jenkins-1.8.2/tests/test_whoami.py
|
||||
===================================================================
|
||||
--- python-jenkins-1.8.0.orig/tests/test_whoami.py
|
||||
+++ python-jenkins-1.8.0/tests/test_whoami.py
|
||||
--- python-jenkins-1.8.2.orig/tests/test_whoami.py
|
||||
+++ python-jenkins-1.8.2/tests/test_whoami.py
|
||||
@@ -1,5 +1,5 @@
|
||||
import json
|
||||
-from mock import patch
|
||||
|
@@ -1,3 +1,21 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Jul 28 04:08:10 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
- Update to 1.8.2:
|
||||
* Fix compatibility with setuptools >= 66
|
||||
* get_build_artifact_as_bytes to support non-json files
|
||||
* Handle 'all' view name when requested 'All'
|
||||
* WrappedSession: Fix URL to requests issue 3829
|
||||
* support urllib3 newer DEFAULT_TIMEOUT
|
||||
* Use multiprocess to avoid pickle errors in tox on macos
|
||||
- Dropped patch use-parts-of-legacy-version.patch:
|
||||
* Merged upstream.
|
||||
- Refreshed patch python-python-jenkins-no-mock.patch:
|
||||
* It was submitted upstream.
|
||||
- Add patch remove-six.patch:
|
||||
* Remove usage of six.
|
||||
- Remove pin against urllib3.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jul 24 06:15:47 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-python-jenkins
|
||||
#
|
||||
# Copyright (c) 2023 SUSE LLC
|
||||
# Copyright (c) 2025 SUSE LLC
|
||||
# Copyright (c) 2014 Thomas Bechtold <thomasbechtold@jpberlin.de>
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
@@ -18,25 +18,24 @@
|
||||
|
||||
|
||||
Name: python-python-jenkins
|
||||
Version: 1.8.0
|
||||
Version: 1.8.2
|
||||
Release: 0
|
||||
Summary: Python bindings for the remote Jenkins API
|
||||
License: BSD-3-Clause
|
||||
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
|
||||
# PATCH-FIX-UPSTREAM Based on https://review.opendev.org/c/jjb/python-jenkins/+/953273
|
||||
Patch0: python-python-jenkins-no-mock.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
|
||||
# PATCH-FIX-UPSTREAM Based on https://opendev.org/jjb/python-jenkins/commit/63b657fe23c3b33903061a17b88787886be3c6dd
|
||||
Patch1: remove-six.patch
|
||||
BuildRequires: %{python_module cmd2}
|
||||
BuildRequires: %{python_module multi_key_dict}
|
||||
BuildRequires: %{python_module multiprocess}
|
||||
BuildRequires: %{python_module pbr >= 0.8.2}
|
||||
BuildRequires: %{python_module pip}
|
||||
BuildRequires: %{python_module requests-mock >= 1.4}
|
||||
BuildRequires: %{python_module requests-mock >= 1.11}
|
||||
BuildRequires: %{python_module requests}
|
||||
BuildRequires: %{python_module testscenarios}
|
||||
BuildRequires: %{python_module urllib3 < 2}
|
||||
BuildRequires: %{python_module wheel}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: openssl-devel
|
||||
@@ -46,8 +45,6 @@ BuildRequires: pkgconfig(krb5-gssapi)
|
||||
Requires: python-multi_key_dict
|
||||
Requires: python-pbr
|
||||
Requires: python-requests
|
||||
Requires: python-six >= 1.3.0
|
||||
Requires: python-urllib3 < 2
|
||||
Provides: python-jenkins = %{version}
|
||||
Obsoletes: python-jenkins < %{version}
|
||||
BuildArch: noarch
|
||||
@@ -79,6 +76,6 @@ sed -i '1{\@^#!%{_bindir}/env python@d}' jenkins/__init__.py
|
||||
%license COPYING
|
||||
%doc README.rst
|
||||
%{python_sitelib}/jenkins
|
||||
%{python_sitelib}/python_jenkins-%{version}*-info
|
||||
%{python_sitelib}/python_jenkins-%{version}.dist-info
|
||||
|
||||
%changelog
|
||||
|
197
remove-six.patch
Normal file
197
remove-six.patch
Normal file
@@ -0,0 +1,197 @@
|
||||
From 63b657fe23c3b33903061a17b88787886be3c6dd Mon Sep 17 00:00:00 2001
|
||||
From: Alexandre Detiste <alexandre.detiste@gmail.com>
|
||||
Date: Sat, 11 Jan 2025 14:55:46 +0100
|
||||
Subject: [PATCH] remove Python2 & six
|
||||
|
||||
Change-Id: I4b64b01d607446a7aa8cbe2070b97717ed6267b5
|
||||
---
|
||||
jenkins/__init__.py | 6 +++---
|
||||
requirements.txt | 1 -
|
||||
setup.cfg | 8 +++++---
|
||||
test-requirements.txt | 1 -
|
||||
tests/base.py | 9 ++-------
|
||||
tests/helper.py | 4 ++--
|
||||
tests/jobs/test_build.py | 4 ++--
|
||||
tests/test_jenkins.py | 11 +++++------
|
||||
tests/test_jenkins_sockets.py | 3 ++-
|
||||
tests/test_promotion.py | 5 ++---
|
||||
10 files changed, 23 insertions(+), 29 deletions(-)
|
||||
|
||||
Index: python-jenkins-1.8.2/jenkins/__init__.py
|
||||
===================================================================
|
||||
--- python-jenkins-1.8.2.orig/jenkins/__init__.py
|
||||
+++ python-jenkins-1.8.2/jenkins/__init__.py
|
||||
@@ -59,9 +59,9 @@ import requests
|
||||
import requests.exceptions as req_exc
|
||||
import urllib3.util.timeout
|
||||
from requests.packages.urllib3.exceptions import InsecureRequestWarning
|
||||
-from six.moves.http_client import BadStatusLine
|
||||
-from six.moves.urllib.error import URLError
|
||||
-from six.moves.urllib.parse import quote, urlencode, urljoin, urlparse
|
||||
+from http.client import BadStatusLine
|
||||
+from urllib.error import URLError
|
||||
+from urllib.parse import quote, urlencode, urljoin, urlparse
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
from jenkins import plugins
|
||||
Index: python-jenkins-1.8.2/requirements.txt
|
||||
===================================================================
|
||||
--- python-jenkins-1.8.2.orig/requirements.txt
|
||||
+++ python-jenkins-1.8.2/requirements.txt
|
||||
@@ -1,4 +1,3 @@
|
||||
-six>=1.3.0
|
||||
pbr>=0.8.2
|
||||
multi_key_dict
|
||||
requests
|
||||
Index: python-jenkins-1.8.2/setup.cfg
|
||||
===================================================================
|
||||
--- python-jenkins-1.8.2.orig/setup.cfg
|
||||
+++ python-jenkins-1.8.2/setup.cfg
|
||||
@@ -19,12 +19,14 @@ classifier =
|
||||
License :: OSI Approved :: BSD License
|
||||
Operating System :: OS Independent
|
||||
Programming Language :: Python
|
||||
- Programming Language :: Python :: 2
|
||||
- Programming Language :: Python :: 2.7
|
||||
Programming Language :: Python :: 3
|
||||
- Programming Language :: Python :: 3.4
|
||||
Programming Language :: Python :: 3.5
|
||||
Programming Language :: Python :: 3.6
|
||||
+ Programming Language :: Python :: 3.7
|
||||
+ Programming Language :: Python :: 3.8
|
||||
+ Programming Language :: Python :: 3.9
|
||||
+ Programming Language :: Python :: 3.10
|
||||
+ Programming Language :: Python :: 3.11
|
||||
|
||||
[files]
|
||||
packages =
|
||||
Index: python-jenkins-1.8.2/test-requirements.txt
|
||||
===================================================================
|
||||
--- python-jenkins-1.8.2.orig/test-requirements.txt
|
||||
+++ python-jenkins-1.8.2/test-requirements.txt
|
||||
@@ -1,7 +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
|
||||
-unittest2
|
||||
python-subunit
|
||||
requests-mock>=1.11.0
|
||||
requests-kerberos<=0.12.0;python_version<'3.6'
|
||||
Index: python-jenkins-1.8.2/tests/base.py
|
||||
===================================================================
|
||||
--- python-jenkins-1.8.2.orig/tests/base.py
|
||||
+++ python-jenkins-1.8.2/tests/base.py
|
||||
@@ -1,15 +1,10 @@
|
||||
-import sys
|
||||
+import unittest
|
||||
+from unittest import mock
|
||||
|
||||
-import mock
|
||||
from testscenarios import TestWithScenarios
|
||||
|
||||
import jenkins
|
||||
|
||||
-if sys.version_info < (2, 7):
|
||||
- import unittest2 as unittest
|
||||
-else:
|
||||
- import unittest
|
||||
-
|
||||
|
||||
class JenkinsTestBase(TestWithScenarios, unittest.TestCase):
|
||||
|
||||
Index: python-jenkins-1.8.2/tests/helper.py
|
||||
===================================================================
|
||||
--- python-jenkins-1.8.2.orig/tests/helper.py
|
||||
+++ python-jenkins-1.8.2/tests/helper.py
|
||||
@@ -2,11 +2,11 @@ import functools
|
||||
import json
|
||||
from multiprocess import Process
|
||||
from multiprocess import Queue
|
||||
+import socketserver
|
||||
import traceback
|
||||
+from unittest.mock import Mock
|
||||
|
||||
-from mock import Mock
|
||||
import requests
|
||||
-from six.moves import socketserver
|
||||
|
||||
|
||||
class TestsTimeoutException(Exception):
|
||||
Index: python-jenkins-1.8.2/tests/jobs/test_build.py
|
||||
===================================================================
|
||||
--- python-jenkins-1.8.2.orig/tests/jobs/test_build.py
|
||||
+++ python-jenkins-1.8.2/tests/jobs/test_build.py
|
||||
@@ -1,8 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
-from mock import patch
|
||||
+from unittest.mock import patch
|
||||
+from urllib.parse import quote
|
||||
|
||||
import jenkins
|
||||
-from six.moves.urllib.parse import quote
|
||||
from tests.helper import build_response_mock
|
||||
from tests.jobs.base import JenkinsJobsTestBase
|
||||
|
||||
Index: python-jenkins-1.8.2/tests/test_jenkins.py
|
||||
===================================================================
|
||||
--- python-jenkins-1.8.2.orig/tests/test_jenkins.py
|
||||
+++ python-jenkins-1.8.2/tests/test_jenkins.py
|
||||
@@ -1,7 +1,6 @@
|
||||
import json
|
||||
-
|
||||
-from mock import patch
|
||||
-import six
|
||||
+import io
|
||||
+from unittest.mock import patch
|
||||
|
||||
from tests.base import JenkinsTestBase
|
||||
from tests.helper import build_response_mock
|
||||
@@ -12,7 +11,7 @@ import jenkins
|
||||
def get_mock_urlopen_return_value(a_dict=None):
|
||||
if a_dict is None:
|
||||
a_dict = {}
|
||||
- return six.BytesIO(json.dumps(a_dict).encode('utf-8'))
|
||||
+ return io.BytesIO(json.dumps(a_dict).encode('utf-8'))
|
||||
|
||||
|
||||
class JenkinsConstructorTest(JenkinsTestBase):
|
||||
@@ -45,8 +44,8 @@ class JenkinsConstructorTest(JenkinsTest
|
||||
|
||||
def test_unicode_password(self):
|
||||
j = jenkins.Jenkins('{0}'.format(self.base_url),
|
||||
- six.u('nonascii'),
|
||||
- six.u('\xe9\u20ac'))
|
||||
+ 'nonascii',
|
||||
+ '\xe9\u20ac')
|
||||
j._maybe_add_auth()
|
||||
self.assertEqual(j.server, self.make_url(''))
|
||||
self.assertEqual(j.auth(self.req).headers['Authorization'],
|
||||
Index: python-jenkins-1.8.2/tests/test_jenkins_sockets.py
|
||||
===================================================================
|
||||
--- python-jenkins-1.8.2.orig/tests/test_jenkins_sockets.py
|
||||
+++ python-jenkins-1.8.2/tests/test_jenkins_sockets.py
|
||||
@@ -1,4 +1,5 @@
|
||||
-from six.moves import StringIO
|
||||
+from io import StringIO
|
||||
+
|
||||
import testtools
|
||||
from testtools.content import text_content
|
||||
|
||||
Index: python-jenkins-1.8.2/tests/test_promotion.py
|
||||
===================================================================
|
||||
--- python-jenkins-1.8.2.orig/tests/test_promotion.py
|
||||
+++ python-jenkins-1.8.2/tests/test_promotion.py
|
||||
@@ -1,11 +1,10 @@
|
||||
import json
|
||||
-from mock import patch
|
||||
+from unittest.mock import patch
|
||||
+from urllib.error import HTTPError
|
||||
|
||||
import jenkins
|
||||
from tests.base import JenkinsTestBase
|
||||
|
||||
-from six.moves.urllib.error import HTTPError
|
||||
-
|
||||
|
||||
class JenkinsPromotionsTestBase(JenkinsTestBase):
|
||||
config_xml = """<hudson.plugins.promoted__builds.PromotionProcess>
|
@@ -1,107 +0,0 @@
|
||||
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)
|
||||
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
|
Reference in New Issue
Block a user