Skip to content
Snippets Groups Projects
Commit 37303690 authored by Sophie Brun's avatar Sophie Brun
Browse files

Import a patch from upstream to fix issue with python3.7 (Closes: #903526)

parent 12b5117d
No related branches found
No related tags found
No related merge requests found
python-jira (1.0.10-2) UNRELEASED; urgency=medium
[ Ondřej Nový ]
* d/control: Set Vcs-* to salsa.debian.org
[ Sophie Brun ]
* Import a patch from upstream to fix issue with python3.7 (Closes: #903526)
-- Ondřej Nový <onovy@debian.org> Tue, 13 Feb 2018 10:06:27 +0100
python-jira (1.0.10-1) unstable; urgency=medium
......
From 206f62b490d792a9c4a10680489ef9f7bc10cb3f Mon Sep 17 00:00:00 2001
From: Sorin Sbarnea <ssbarnea@users.noreply.github.com>
Date: Tue, 3 Jul 2018 09:40:01 +0100
Subject: [PATCH] api: py37 support and rename async to async_ (#604)
Breaking change as is renames all async parameters to async_
in order to assure python 3.7 compatibility.
In Debian: just pick up the relevant modifications for the version we
have.
--- a/jira/client.py
+++ b/jira/client.py
@@ -196,7 +196,7 @@ class JIRA(object):
AGILE_BASE_URL = GreenHopperResource.AGILE_BASE_URL
def __init__(self, server=None, options=None, basic_auth=None, oauth=None, jwt=None, kerberos=False,
- validate=False, get_server_info=True, async=False, logging=True, max_retries=3, proxies=None,
+ validate=False, get_server_info=True, async_=False, logging=True, max_retries=3, proxies=None,
timeout=None):
"""Construct a JIRA client instance.
@@ -241,7 +241,7 @@ class JIRA(object):
as anononymous it will fail to instanciate.
:param get_server_info: If true it will fetch server version info first to determine if some API calls
are available.
- :param async: To enable async requests for those actions where we implemented it, like issue update() or delete().
+ :param async_: To enable async requests for those actions where we implemented it, like issue update() or delete().
:param timeout: Set a read/connect timeout for the underlying calls to JIRA (default: None)
Obviously this means that you cannot rely on the return code when this is enabled.
"""
@@ -260,8 +260,8 @@ class JIRA(object):
if server:
options['server'] = server
- if async:
- options['async'] = async
+ if async_:
+ options['async'] = async_
self.logging = logging
@@ -476,12 +476,12 @@ class JIRA(object):
return resource
def async_do(self, size=10):
- """Execute all async jobs and wait for them to finish. By default it will run on 10 threads.
+ """Execute all asynchronous jobs and wait for them to finish. By default it will run on 10 threads.
:param size: number of threads to run on.
"""
if hasattr(self._session, '_async_jobs'):
- logging.info("Executing async %s jobs found in queue by using %s threads..." % (
+ logging.info("Executing asynchronous %s jobs found in queue by using %s threads..." % (
len(self._session._async_jobs), size))
threaded_requests.map(self._session._async_jobs, size=size)
@@ -3072,8 +3072,8 @@ class JIRA(object):
class GreenHopper(JIRA):
- def __init__(self, options=None, basic_auth=None, oauth=None, async=None):
+ def __init__(self, options=None, basic_auth=None, oauth=None, async_=None):
warnings.warn(
"GreenHopper() class is deprecated, just use JIRA() instead.", DeprecationWarning)
JIRA.__init__(
- self, options=options, basic_auth=basic_auth, oauth=oauth, async=async)
+ self, options=options, basic_auth=basic_auth, oauth=oauth, async_=async_)
--- a/jira/resources.py
+++ b/jira/resources.py
@@ -201,17 +201,17 @@ class Resource(object):
options.update({'path': path})
return self._base_url.format(**options)
- def update(self, fields=None, async=None, jira=None, notify=True, **kwargs):
+ def update(self, fields=None, async_=None, jira=None, notify=True, **kwargs):
"""Update this resource on the server.
Keyword arguments are marshalled into a dict before being sent. If this
resource doesn't support ``PUT``, a :py:exc:`.JIRAError` will be raised; subclasses that specialize this method
will only raise errors in case of user error.
- :param async: if true the request will be added to the queue so it can be executed later using async_run()
+ :param async_: if true the request will be added to the queue so it can be executed later using async_run()
"""
- if async is None:
- async = self._options['async']
+ if async_ is None:
+ async_ = self._options['async']
data = {}
if fields is not None:
@@ -280,7 +280,7 @@ class Resource(object):
# data['fields']['assignee'] = {'name': self._options['autofix']}
# EXPERIMENTAL --->
# import grequests
- if async:
+ if async_:
if not hasattr(self._session, '_async_jobs'):
self._session._async_jobs = set()
self._session._async_jobs.add(threaded_requests.put(
@@ -429,7 +429,7 @@ class Issue(Resource):
if raw:
self._parse_raw(raw)
- def update(self, fields=None, update=None, async=None, jira=None, notify=True, **fieldargs):
+ def update(self, fields=None, update=None, async_=None, jira=None, notify=True, **fieldargs):
"""Update this issue on the server.
Each keyword argument (other than the predefined ones) is treated as a field name and the argument's value
@@ -477,7 +477,7 @@ class Issue(Resource):
else:
fields_dict[field] = value
- super(Issue, self).update(async=async, jira=jira, notify=notify, fields=data)
+ super(Issue, self).update(async_=async_, jira=jira, notify=notify, fields=data)
def add_field_value(self, field, value):
"""Add a value to a field that supports multiple values, without resetting the existing values.
@@ -513,7 +513,7 @@ class Comment(Resource):
if raw:
self._parse_raw(raw)
- def update(self, fields=None, async=None, jira=None, body='', visibility=None):
+ def update(self, fields=None, async_=None, jira=None, body='', visibility=None):
data = {}
if body:
data['body'] = body
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -14,6 +14,9 @@ pytest-cov
pytest-instafail
pytest-xdist>=1.14
pytest>=2.9.1
+PyYAML>=3.12,<4; python_version<'3.7'
+# this file is needed by readthedocs.org so don't move them in another place
+PyYAML>=4.2b2; python_version>='3.7'
requires.io
sphinx>=1.3.5
sphinx_rtd_theme
--- a/tox.ini
+++ b/tox.ini
@@ -1,6 +1,6 @@
[tox]
minversion = 2.3.1
-envlist = {py27,py34,py35,py36}-{win,linux,darwin},docs
+envlist = {py27,py34,py35,py36,py37}-{win,linux,darwin},docs
skip_missing_interpreters = true
[testenv:docs]
fix-install-python3.7.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment