Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-python-jenkins for
openSUSE:Factory checked in at 2025-07-28 14:58:29
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-python-jenkins (Old)
and /work/SRC/openSUSE:Factory/.python-python-jenkins.new.13279 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-python-jenkins"
Mon Jul 28 14:58:29 2025 rev:15 rq:1295994 version:1.8.2
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-python-jenkins/python-python-jenkins.changes
2023-07-25 11:52:31.589952479 +0200
+++
/work/SRC/openSUSE:Factory/.python-python-jenkins.new.13279/python-python-jenkins.changes
2025-07-28 14:58:35.659388404 +0200
@@ -1,0 +2,18 @@
+Mon Jul 28 04:08:10 UTC 2025 - Steve Kowalik <[email protected]>
+
+- 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.
+
+-------------------------------------------------------------------
Old:
----
python-jenkins-1.8.0.tar.gz
use-parts-of-legacy-version.patch
New:
----
python-jenkins-1.8.2.tar.gz
remove-six.patch
----------(Old B)----------
Old: * Use multiprocess to avoid pickle errors in tox on macos
- Dropped patch use-parts-of-legacy-version.patch:
* Merged upstream.
----------(Old E)----------
----------(New B)----------
New: * It was submitted upstream.
- Add patch remove-six.patch:
* Remove usage of six.
----------(New E)----------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-python-jenkins.spec ++++++
--- /var/tmp/diff_new_pack.H9LJtY/_old 2025-07-28 14:58:36.339416731 +0200
+++ /var/tmp/diff_new_pack.H9LJtY/_new 2025-07-28 14:58:36.343416899 +0200
@@ -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 <[email protected]>
#
# 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 @@
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,5 +76,5 @@
%license COPYING
%doc README.rst
%{python_sitelib}/jenkins
-%{python_sitelib}/python_jenkins-%{version}*-info
+%{python_sitelib}/python_jenkins-%{version}.dist-info
++++++ python-jenkins-1.8.0.tar.gz -> python-jenkins-1.8.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-jenkins-1.8.0/.zuul.yaml
new/python-jenkins-1.8.2/.zuul.yaml
--- old/python-jenkins-1.8.0/.zuul.yaml 2023-03-24 15:50:48.000000000 +0100
+++ new/python-jenkins-1.8.2/.zuul.yaml 2023-11-09 11:19:17.000000000 +0100
@@ -2,25 +2,59 @@
- job:
name: jjb-tox-cross-jenkins-job-builder
description: Tests compatibility with master branch of jenkins-job-builder
- parent: tox-py27
+ parent: tox-py311
+ nodeset: ubuntu-jammy
required-projects:
- jjb/python-jenkins
- jjb/jenkins-job-builder
voting: true
- project:
- templates:
- - build-openstack-docs-pti
- - openstack-cover-jobs
- - openstack-python35-jobs
- - openstack-python36-jobs
check:
jobs:
- - openstack-tox-linters
- - openstack-tox-py27
+ # Only in check:
+ - tox-cover:
+ nodeset: ubuntu-xenial
+ # Jobs common to gate pipeline
+ - tox-linters
+ - opendev-tox-docs:
+ nodeset: ubuntu-xenial
+ - tox-py27:
+ nodeset: ubuntu-xenial
+ - tox-py35:
+ nodeset: ubuntu-xenial
+ - tox-py36:
+ nodeset: ubuntu-bionic
+ - tox-py37:
+ nodeset: ubuntu-bionic
+ - tox-py38:
+ nodeset: ubuntu-focal
+ - tox-py39:
+ nodeset: ubuntu-focal
+ - tox-py310:
+ nodeset: ubuntu-jammy
+ - tox-py311:
+ nodeset: ubuntu-jammy
- jjb-tox-cross-jenkins-job-builder
gate:
jobs:
- - openstack-tox-linters
- - openstack-tox-py27
+ - tox-linters
+ - opendev-tox-docs:
+ nodeset: ubuntu-xenial
+ - tox-py27:
+ nodeset: ubuntu-xenial
+ - tox-py35:
+ nodeset: ubuntu-xenial
+ - tox-py36:
+ nodeset: ubuntu-bionic
+ - tox-py37:
+ nodeset: ubuntu-bionic
+ - tox-py38:
+ nodeset: ubuntu-focal
+ - tox-py39:
+ nodeset: ubuntu-focal
+ - tox-py310:
+ nodeset: ubuntu-jammy
+ - tox-py311:
+ nodeset: ubuntu-jammy
- jjb-tox-cross-jenkins-job-builder
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-jenkins-1.8.0/AUTHORS
new/python-jenkins-1.8.2/AUTHORS
--- old/python-jenkins-1.8.0/AUTHORS 2023-03-24 15:51:12.000000000 +0100
+++ new/python-jenkins-1.8.2/AUTHORS 2023-11-09 11:19:41.000000000 +0100
@@ -15,6 +15,7 @@
Brandon Leonard <[email protected]>
Chris St. Pierre <[email protected]>
Christian Berendt <[email protected]>
+Christoph Erhardt <[email protected]>
Clark Boylan <[email protected]>
Darragh Bailey <[email protected]>
Darragh Bailey <[email protected]>
@@ -44,8 +45,10 @@
K Jonathan Harker <[email protected]>
Kazuhiro Suzuki <[email protected]>
Ken Conley [email protected] <>
+Ken Dreyer <[email protected]>
Ken Dreyer <[email protected]>
Ken Rumer <[email protected]>
+Kenyon Ralph <[email protected]>
Kevin L. Mitchell <[email protected]>
Kevin McDermott <[email protected]>
Khai Do <[email protected]>
@@ -70,6 +73,7 @@
Thanh Ha <[email protected]>
Tomas Janousek <[email protected]>
Vieri <[email protected]>
+Vsevolod Fedorov <[email protected]>
ZhangHongtao <[email protected]>
grahamlyons <[email protected]>
huang.zhiping <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-jenkins-1.8.0/ChangeLog
new/python-jenkins-1.8.2/ChangeLog
--- old/python-jenkins-1.8.0/ChangeLog 2023-03-24 15:51:12.000000000 +0100
+++ new/python-jenkins-1.8.2/ChangeLog 2023-11-09 11:19:41.000000000 +0100
@@ -1,6 +1,22 @@
CHANGES
=======
+1.8.2
+-----
+
+* Fix compatibility with setuptools >= 66
+* get\_build\_artifact\_as\_bytes to support non-json files
+
+1.8.1
+-----
+
+* STORY 2010790: Handle 'all' view name when requested 'All'
+* WrappedSession: Fix URL to requests issue 3829
+* CI: add support to python 37 to 311
+* support urllib3 newer DEFAULT\_TIMEOUT
+* Use multiprocess to avoid pickle errors in tox on macos
+* CI: move out of OpenStack Zuul templates
+
1.8.0
-----
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-jenkins-1.8.0/PKG-INFO
new/python-jenkins-1.8.2/PKG-INFO
--- old/python-jenkins-1.8.0/PKG-INFO 2023-03-24 15:51:12.177868000 +0100
+++ new/python-jenkins-1.8.2/PKG-INFO 2023-11-09 11:19:42.099474000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.2
Name: python-jenkins
-Version: 1.8.0
+Version: 1.8.2
Summary: Python bindings for the remote Jenkins API
Home-page: https://opendev.org/jjb/python-jenkins
Author: Ken Conley
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-jenkins-1.8.0/jenkins/__init__.py
new/python-jenkins-1.8.2/jenkins/__init__.py
--- old/python-jenkins-1.8.0/jenkins/__init__.py 2023-03-24
15:50:48.000000000 +0100
+++ new/python-jenkins-1.8.2/jenkins/__init__.py 2023-11-09
11:19:17.000000000 +0100
@@ -58,6 +58,7 @@
import multi_key_dict
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
@@ -91,6 +92,7 @@
LAUNCHER_JNLP = 'hudson.slaves.JNLPLauncher'
LAUNCHER_WINDOWS_SERVICE = 'hudson.os.windows.ManagedWindowsServiceLauncher'
DEFAULT_HEADERS = {'Content-Type': 'text/xml; charset=utf-8'}
+DEFAULT_TIMEOUT = getattr(urllib3.util.timeout, '_DEFAULT_TIMEOUT',
socket._GLOBAL_DEFAULT_TIMEOUT)
# REST Endpoints
INFO = 'api/json'
@@ -280,7 +282,7 @@
class WrappedSession(requests.Session):
"""A wrapper for requests.Session to override 'verify' property, ignoring
REQUESTS_CA_BUNDLE environment variable.
- This is a workaround for
https://github.com/kennethreitz/requests/issues/3829 (will be fixed in requests
3.0.0)
+ This is a workaround for https://github.com/psf/requests/issues/3829 (will
be fixed in requests 3.0.0)
"""
def merge_environment_settings(self, url, proxies, stream, verify, *args,
@@ -300,7 +302,7 @@
_timeout_warning_issued = False
def __init__(self, url, username=None, password=None,
- timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
+ timeout=DEFAULT_TIMEOUT):
'''Create handle to Jenkins instance.
All methods will raise :class:`JenkinsException` on failure.
@@ -542,13 +544,13 @@
# when accessing .text property
return response
- def _request(self, req):
+ def _request(self, req, stream=None):
r = self._session.prepare_request(req)
# requests.Session.send() does not honor env settings by design
# see https://github.com/requests/requests/issues/2807
_settings = self._session.merge_environment_settings(
- r.url, {}, None, self._session.verify, None)
+ r.url, {}, stream, self._session.verify, None)
_settings['timeout'] = self.timeout
return self._session.send(r, **_settings)
@@ -559,7 +561,14 @@
'''
return self.jenkins_request(req, add_crumb, resolve_auth).text
- def jenkins_request(self, req, add_crumb=True, resolve_auth=True):
+ def jenkins_open_stream(self, req, add_crumb=True, resolve_auth=True):
+ '''Return the HTTP response body from a ``requests.Request``.
+
+ :returns: ``stream``
+ '''
+ return self.jenkins_request(req, add_crumb, resolve_auth, True)
+
+ def jenkins_request(self, req, add_crumb=True, resolve_auth=True,
stream=None):
'''Utility routine for opening an HTTP request to a Jenkins server.
:param req: A ``requests.Request`` to submit.
@@ -567,6 +576,7 @@
before submitting. Defaults to ``True``.
:param resolve_auth: If True, maybe add authentication. Defaults to
``True``.
+ :param stream: If True, return a stream
:returns: A ``requests.Response`` object.
'''
try:
@@ -576,7 +586,7 @@
self.maybe_add_crumb(req)
return self._response_handler(
- self._request(req))
+ self._request(req, stream))
except req_exc.HTTPError as e:
# Jenkins's funky authentication means its nigh impossible to
@@ -740,6 +750,27 @@
# This can happen if the artifact is not found
return None
+ def get_build_artifact_as_bytes(self, name, number, artifact):
+ """Get artifacts from job
+
+ :param name: Job name, ``str``
+ :param number: Build number, ``str`` (also accepts ``int``)
+ :param artifact: Artifact relative path, ``str``
+ :returns: artifact to download, ``bytes``
+ """
+ folder_url, short_name = self._get_job_folder(name)
+
+ try:
+ with self.jenkins_open_stream(requests.Request(
+ 'GET', self._build_url(BUILD_ARTIFACT, locals()))) as
response:
+ if response.encoding is None:
+ return response.raw.read()
+ else:
+ return response.text.encode(response.encoding)
+ raise JenkinsException('job[%s] number[%s] does not exist' %
(name, number))
+ except requests.exceptions.HTTPError:
+ raise JenkinsException('job[%s] number[%s] does not exist' %
(name, number))
+
def get_build_stages(self, name, number):
"""Get stages info from job
@@ -1796,6 +1827,8 @@
return None
else:
actual = json.loads(response)['name']
+ if actual == 'all':
+ actual = 'All'
if actual != short_name:
raise JenkinsException(
'Jenkins returned an unexpected view name %s '
@@ -2247,7 +2280,7 @@
raise ValueError("Timeout must be >= 0 not %d" % timeout)
if (not self._timeout_warning_issued and
- self.timeout != socket._GLOBAL_DEFAULT_TIMEOUT and
+ self.timeout != DEFAULT_TIMEOUT and
timeout < self.timeout):
warnings.warn("Requested timeout to wait for jenkins to resume "
"normal operations is less than configured "
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-jenkins-1.8.0/jenkins/plugins.py
new/python-jenkins-1.8.2/jenkins/plugins.py
--- old/python-jenkins-1.8.0/jenkins/plugins.py 2023-03-24 15:50:48.000000000
+0100
+++ new/python-jenkins-1.8.2/jenkins/plugins.py 2023-11-09 11:19:17.000000000
+0100
@@ -42,8 +42,6 @@
import operator
import re
-import pkg_resources
-
class Plugin(dict):
'''Dictionary object containing plugin metadata.'''
@@ -76,15 +74,13 @@
'''Parse plugin version and store it for comparison.'''
self._version = version
- self.parsed_version = pkg_resources.parse_version(
- self.__convert_version(version))
+ self._key = _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._key, PluginVersion(version)._key)
def __le__(self, version):
return self.__compare(operator.le, version)
@@ -109,3 +105,92 @@
def __repr__(self):
return str(self._version)
+
+
+###############################################################################
+"""
+The Python world has migrated to the versioning scheme defined in PEP 440, but
+the versioning of Jenkins plugins is less strict than that. The code below was
+salvaged from the implementation of the `LegacyVersion` class, which used to be
+part of the `packaging` library prior to version 22.0.
+
+It is licensed as follows.
+
+Copyright (c) Donald Stufft and individual contributors.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+"""
+
+_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):
+ 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):
+
+ # 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 = []
+ 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)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-jenkins-1.8.0/python_jenkins.egg-info/PKG-INFO
new/python-jenkins-1.8.2/python_jenkins.egg-info/PKG-INFO
--- old/python-jenkins-1.8.0/python_jenkins.egg-info/PKG-INFO 2023-03-24
15:51:12.000000000 +0100
+++ new/python-jenkins-1.8.2/python_jenkins.egg-info/PKG-INFO 2023-11-09
11:19:41.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.2
Name: python-jenkins
-Version: 1.8.0
+Version: 1.8.2
Summary: Python bindings for the remote Jenkins API
Home-page: https://opendev.org/jjb/python-jenkins
Author: Ken Conley
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-jenkins-1.8.0/python_jenkins.egg-info/pbr.json
new/python-jenkins-1.8.2/python_jenkins.egg-info/pbr.json
--- old/python-jenkins-1.8.0/python_jenkins.egg-info/pbr.json 2023-03-24
15:51:12.000000000 +0100
+++ new/python-jenkins-1.8.2/python_jenkins.egg-info/pbr.json 2023-11-09
11:19:41.000000000 +0100
@@ -1 +1 @@
-{"git_version": "70dc3e4", "is_release": true}
\ No newline at end of file
+{"git_version": "876a2a9", "is_release": true}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/python-jenkins-1.8.0/python_jenkins.egg-info/requires.txt
new/python-jenkins-1.8.2/python_jenkins.egg-info/requires.txt
--- old/python-jenkins-1.8.0/python_jenkins.egg-info/requires.txt
2023-03-24 15:51:12.000000000 +0100
+++ new/python-jenkins-1.8.2/python_jenkins.egg-info/requires.txt
2023-11-09 11:19:41.000000000 +0100
@@ -1,5 +1,4 @@
multi_key_dict
pbr>=0.8.2
requests
-setuptools<66
six>=1.3.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-jenkins-1.8.0/requirements.txt
new/python-jenkins-1.8.2/requirements.txt
--- old/python-jenkins-1.8.0/requirements.txt 2023-03-24 15:50:48.000000000
+0100
+++ new/python-jenkins-1.8.2/requirements.txt 2023-11-09 11:19:17.000000000
+0100
@@ -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
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-jenkins-1.8.0/test-requirements.txt
new/python-jenkins-1.8.2/test-requirements.txt
--- old/python-jenkins-1.8.0/test-requirements.txt 2023-03-24
15:50:48.000000000 +0100
+++ new/python-jenkins-1.8.2/test-requirements.txt 2023-11-09
11:19:17.000000000 +0100
@@ -4,7 +4,7 @@
mock
unittest2
python-subunit
-requests-mock>=1.4.0
+requests-mock>=1.11.0
requests-kerberos<=0.12.0;python_version<'3.6'
requests-kerberos;python_version>='3.6'
sphinx>=1.6.0,<2.0.0;python_version=='2.7' # BSD
@@ -13,3 +13,4 @@
testscenarios
testtools
pre-commit
+multiprocess
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-jenkins-1.8.0/tests/helper.py
new/python-jenkins-1.8.2/tests/helper.py
--- old/python-jenkins-1.8.0/tests/helper.py 2023-03-24 15:50:48.000000000
+0100
+++ new/python-jenkins-1.8.2/tests/helper.py 2023-11-09 11:19:17.000000000
+0100
@@ -1,7 +1,7 @@
import functools
import json
-from multiprocessing import Process
-from multiprocessing import Queue
+from multiprocess import Process
+from multiprocess import Queue
import traceback
from mock import Mock
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-jenkins-1.8.0/tests/test_build.py
new/python-jenkins-1.8.2/tests/test_build.py
--- old/python-jenkins-1.8.0/tests/test_build.py 2023-03-24
15:50:48.000000000 +0100
+++ new/python-jenkins-1.8.2/tests/test_build.py 2023-11-09
11:19:17.000000000 +0100
@@ -1,7 +1,7 @@
import json
import collections
-from mock import patch
+from mock import patch, Mock
import jenkins
from tests.base import JenkinsTestBase
@@ -810,6 +810,114 @@
self.assertEqual(
str(context_manager.exception),
'Error in request. Possibly authentication failed [401]: Not
Authorised')
+
+
+class JenkinsBuildArtifactAsBytesUrlTest(JenkinsTestBase):
+
+ def streamMock(self, encoding=None, text=None, binary=None):
+ streamMock = Mock()
+ streamMock.__exit__ = Mock()
+ streamMock.__enter__ = Mock()
+ if encoding is None and text is None and binary is None:
+ streamMock.__enter__.return_value = None
+ return streamMock
+ streamMock.__enter__.return_value = Mock()
+ streamMock.__enter__.return_value.encoding = encoding
+ streamMock.__enter__.return_value.text = text
+ streamMock.__enter__.return_value.raw = Mock()
+ streamMock.__enter__.return_value.raw.read = Mock()
+ streamMock.__enter__.return_value.raw.read.return_value = binary
+ return streamMock
+
+ @patch.object(jenkins.Jenkins, 'jenkins_open_stream')
+ def test_simple_ascii_artifact(self, jenkins_mock):
+ jenkins_mock.return_value = self.streamMock('utf-8', 'ascii')
+ ret = self.j.get_build_artifact_as_bytes(u'Test Job', number='52',
artifact="filename")
+ self.assertEqual(ret, b'ascii')
+ self.assertEqual(
+ jenkins_mock.call_args[0][0].url,
+ self.make_url('job/Test%20Job/52/artifact/filename'))
+ self._check_requests(jenkins_mock.call_args_list)
+
+ @patch.object(jenkins.Jenkins, 'jenkins_open_stream')
+ def test_simple_binary_artifact(self, jenkins_mock):
+ jenkins_mock.return_value = self.streamMock(binary=b'\0\1\2')
+ ret = self.j.get_build_artifact_as_bytes(u'Test Job', number='52',
artifact="filename")
+ self.assertEqual(ret, b'\0\1\2')
+ self.assertEqual(
+ jenkins_mock.call_args[0][0].url,
+ self.make_url('job/Test%20Job/52/artifact/filename'))
+ self._check_requests(jenkins_mock.call_args_list)
+
+ @patch.object(jenkins.Jenkins, 'jenkins_open_stream')
+ def test_in_folder(self, jenkins_mock):
+ jenkins_mock.return_value = self.streamMock('utf-8', 'ascii')
+ ret = self.j.get_build_artifact_as_bytes(u'a Folder/Test Job',
number='52', artifact="file name")
+ self.assertEqual(ret, b'ascii')
+ self.assertEqual(
+ jenkins_mock.call_args[0][0].url,
+
self.make_url('job/a%20Folder/job/Test%20Job/52/artifact/file%20name'))
+ self._check_requests(jenkins_mock.call_args_list)
+
+ @patch.object(jenkins.Jenkins, 'jenkins_open_stream')
+ def test_matrix(self, jenkins_mock):
+ jenkins_mock.return_value = self.streamMock('utf-8', 'ascii')
+ ret = self.j.get_build_artifact_as_bytes(u'a Folder/Test Job',
number='52/index=matrix',
+ artifact="file name")
+ self.assertEqual(ret, b'ascii')
+ self.assertEqual(
+ jenkins_mock.call_args[0][0].url,
+
self.make_url('job/a%20Folder/job/Test%20Job/52/index=matrix/artifact/file%20name'))
+ self._check_requests(jenkins_mock.call_args_list)
+
+ @patch('jenkins.requests.Session.send', autospec=True)
+ def test_404_item_not_found(self, session_send_mock):
+ session_send_mock.side_effect = iter([
+ build_response_mock(404, reason="Not Found"), # crumb
+ build_response_mock(404, reason="Not Found"), # request
+ ])
+ with self.assertRaises(jenkins.JenkinsException) as context_manager:
+ self.j.get_build_artifact_as_bytes(u'TestJob', number='52',
artifact="filename")
+ self.assertEqual(
+ str(context_manager.exception),
+ 'Requested item could not be found')
+
+ @patch.object(jenkins.Jenkins, 'jenkins_open_stream')
+ def test_open_return_none(self, jenkins_mock):
+ jenkins_mock.return_value = self.streamMock()
+
+ with self.assertRaises(jenkins.JenkinsException) as context_manager:
+ self.j.get_build_artifact_as_bytes(u'TestJob', number='52',
artifact="filename")
+ self.assertEqual(
+ str(context_manager.exception),
+ 'job[TestJob] number[52] does not exist')
+ self._check_requests(jenkins_mock.call_args_list)
+
+ @patch('jenkins.requests.Session.send', autospec=True)
+ def test_raise_HTTPError(self, session_send_mock):
+ session_send_mock.side_effect = iter([
+ build_response_mock(401, reason="Not Authorised"), # crumb
+ build_response_mock(401, reason="Not Authorised"), # request
+ ])
+
+ with self.assertRaises(jenkins.JenkinsException) as context_manager:
+ self.j.get_build_artifact_as_bytes(u'TestJob', number='52',
artifact="filename")
+ self.assertEqual(
+ str(context_manager.exception),
+ 'Error in request. Possibly authentication failed [401]: Not
Authorised')
+
+ @patch('jenkins.requests.Session.send', autospec=True)
+ def test_in_folder_raise_HTTPError(self, session_send_mock):
+ session_send_mock.side_effect = iter([
+ build_response_mock(401, reason="Not Authorised"), # crumb
+ build_response_mock(401, reason="Not Authorised"), # request
+ ])
+
+ with self.assertRaises(jenkins.JenkinsException) as context_manager:
+ self.j.get_build_artifact_as_bytes(u'a Folder/TestJob',
number='52', artifact="filename")
+ self.assertEqual(
+ str(context_manager.exception),
+ 'Error in request. Possibly authentication failed [401]: Not
Authorised')
class JenkinsBuildStagesUrlTest(JenkinsTestBase):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-jenkins-1.8.0/tests/test_jenkins.py
new/python-jenkins-1.8.2/tests/test_jenkins.py
--- old/python-jenkins-1.8.0/tests/test_jenkins.py 2023-03-24
15:50:48.000000000 +0100
+++ new/python-jenkins-1.8.2/tests/test_jenkins.py 2023-11-09
11:19:17.000000000 +0100
@@ -1,5 +1,4 @@
import json
-import socket
from mock import patch
import six
@@ -68,7 +67,7 @@
def test_default_timeout(self):
j = jenkins.Jenkins('{0}'.format(self.base_url))
- self.assertEqual(j.timeout, socket._GLOBAL_DEFAULT_TIMEOUT)
+ self.assertEqual(j.timeout, jenkins.DEFAULT_TIMEOUT)
def test_custom_timeout(self):
j = jenkins.Jenkins('{0}'.format(self.base_url), timeout=300)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/python-jenkins-1.8.0/tox.ini
new/python-jenkins-1.8.2/tox.ini
--- old/python-jenkins-1.8.0/tox.ini 2023-03-24 15:50:48.000000000 +0100
+++ new/python-jenkins-1.8.2/tox.ini 2023-11-09 11:19:17.000000000 +0100
@@ -1,7 +1,7 @@
[tox]
minversion = 2.0
skipsdist = True
-envlist = py{34,27,35,36}, linters
+envlist = py{34,27,35,36,37,38,39,310,311}, linters
[testenv]
setenv =
++++++ python-python-jenkins-no-mock.patch ++++++
--- /var/tmp/diff_new_pack.H9LJtY/_old 2025-07-28 14:58:36.491423063 +0200
+++ /var/tmp/diff_new_pack.H9LJtY/_new 2025-07-28 14:58:36.495423230 +0200
@@ -1,92 +1,62 @@
+From c37936698341e1bbbec2b9b62dfc64ddc51f3dfd Mon Sep 17 00:00:00 2001
+From: Steve Kowalik <[email protected]>
+Date: Wed, 25 Jun 2025 16:02:31 +1000
+Subject: [PATCH] Stop using external mock module
+
+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 | 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(-)
+ 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.0/test-requirements.txt
+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
-===================================================================
---- 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
+ requests-mock>=1.11.0
+Index: python-jenkins-1.8.2/tests/jobs/test_assert.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 @@
import jenkins
from tests.jobs.base import JenkinsJobsTestBase
-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
-+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
+Index: python-jenkins-1.8.2/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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
import jenkins
from tests.base import JenkinsTestBase
-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
-
--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
+Index: python-jenkins-1.8.2/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 @@
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,21 +306,10 @@
from testscenarios.scenarios import multiply_scenarios
import jenkins
-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
-+from unittest.mock import patch
-
- 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_queue.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_queue.py
++++ python-jenkins-1.8.2/tests/test_queue.py
@@ -1,5 +1,5 @@
import json
-from mock import patch
@@ -382,10 +317,10 @@
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_quiet_down.py
===================================================================
---- python-jenkins-1.8.0.orig/tests/test_quiet_down.py
-+++ python-jenkins-1.8.0/tests/test_quiet_down.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
@@ -393,30 +328,30 @@
import jenkins
from tests.base import JenkinsTestBase
-Index: python-jenkins-1.8.0/tests/test_script.py
+Index: python-jenkins-1.8.2/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 @@
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
++++++ remove-six.patch ++++++
>From 63b657fe23c3b33903061a17b88787886be3c6dd Mon Sep 17 00:00:00 2001
From: Alexandre Detiste <[email protected]>
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>