Skip to content

Commit fb5f845

Browse files
authored
Maintain support for versions of Python <3.6 (#1204)
* Python2: Remove trailing commas after ** unpacking operators In Python2 it's not valid to have a comma after a final argument using the ** unpacking operator. Add fmt: skip to preserve Black formatting. * Python2: Use six.moves.urllib
1 parent 70019f5 commit fb5f845

File tree

14 files changed

+43
-42
lines changed

14 files changed

+43
-42
lines changed

atlassian/bamboo.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ def base_list_call(
7070
max_results,
7171
label=None,
7272
start_index=0,
73-
**kwargs,
74-
):
73+
**kwargs
74+
): # fmt: skip
7575
flags = []
7676
params = {"max-results": max_results}
7777
if expand:
@@ -383,8 +383,8 @@ def results(
383383
elements_key="results",
384384
element_key="result",
385385
label=label,
386-
**params,
387-
)
386+
**params
387+
) # fmt: skip
388388

389389
def latest_results(
390390
self,
@@ -572,8 +572,8 @@ def execute_build(
572572
stage=None,
573573
execute_all_stages=True,
574574
custom_revision=None,
575-
**bamboo_variables,
576-
):
575+
**bamboo_variables
576+
): # fmt: skip
577577
"""
578578
Fire build execution for specified plan.
579579
!IMPORTANT! NOTE: for some reason, this method always execute all stages

atlassian/bitbucket/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2378,8 +2378,8 @@ def create_code_insights_report(
23782378
commit_id,
23792379
report_key,
23802380
report_title,
2381-
**report_params,
2382-
):
2381+
**report_params
2382+
): # fmt: skip
23832383
"""
23842384
Create a new insight report, or replace the existing one
23852385
if a report already exists for the given repository_slug, commit, and report key.

atlassian/bitbucket/cloud/common/comments.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ def __init__(self, data, *args, **kwargs):
1010
*args,
1111
data=data,
1212
expected_type="pullrequest_comment",
13-
**kwargs,
14-
)
13+
**kwargs
14+
) # fmt: skip
1515

1616
@property
1717
def raw(self):

atlassian/bitbucket/cloud/repositories/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,8 @@ def __init__(self, data, *args, **kwargs):
257257
self.__commits = Commits(
258258
"{}/commits".format(self.url),
259259
data={"links": {"commit": {"href": "{}/commit".format(self.url)}}},
260-
**self._new_session_args,
261-
)
260+
**self._new_session_args
261+
) # fmt: skip
262262
self.__default_reviewers = DefaultReviewers("{}/default-reviewers".format(self.url), **self._new_session_args)
263263
self.__deployment_environments = DeploymentEnvironments(
264264
"{}/environments".format(self.url), **self._new_session_args

atlassian/bitbucket/cloud/repositories/commits.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ def get_build(self, key):
139139
"""
140140
return Build(
141141
super(Commit, self).get(self.url_joiner("statuses/build", key)),
142-
**self._new_session_args,
143-
)
142+
**self._new_session_args
143+
) # fmt: skip
144144

145145
def comments(self):
146146
"""

atlassian/bitbucket/cloud/repositories/defaultReviewers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ def __get_object(self, data):
1414
return DefaultReviewer(
1515
self.url_joiner(self.url, data["uuid"]),
1616
data,
17-
**self._new_session_args,
18-
)
17+
**self._new_session_args
18+
) # fmt: skip
1919

2020
def add(self, user):
2121
"""

atlassian/bitbucket/cloud/repositories/deploymentEnvironments.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from ..base import BitbucketCloudBase
44

5-
from urllib.parse import urlunsplit, urlsplit
5+
from six.moves.urllib.parse import urlunsplit, urlsplit
66

77

88
class DeploymentEnvironments(BitbucketCloudBase):
@@ -13,8 +13,8 @@ def __get_object(self, data):
1313
return DeploymentEnvironment(
1414
self.url_joiner(self.url, data["uuid"]),
1515
data,
16-
**self._new_session_args,
17-
)
16+
**self._new_session_args
17+
) # fmt: skip
1818

1919
def each(self):
2020
"""
@@ -141,8 +141,8 @@ def __get_object(self, data):
141141
return DeploymentEnvironmentVariable(
142142
self.url,
143143
data,
144-
**self._new_session_args,
145-
)
144+
**self._new_session_args
145+
) # fmt: skip
146146

147147
def create(self, key, value, secured):
148148
"""

atlassian/bitbucket/cloud/repositories/groupPermissions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ def __get_object(self, data):
1111
return GroupPermission(
1212
self.url,
1313
data,
14-
**self._new_session_args,
15-
)
14+
**self._new_session_args
15+
) # fmt: skip
1616

1717
def each(self, q=None, sort=None):
1818
"""

atlassian/bitbucket/cloud/repositories/pipelines.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ def __get_object(self, data):
1414
return Pipeline(
1515
self.url_joiner(self.url, data["uuid"]),
1616
data,
17-
**self._new_session_args,
18-
)
17+
**self._new_session_args
18+
) # fmt: skip
1919

2020
def trigger(self, branch="master", type="custom", commit=None, pattern=None, variables=None):
2121
"""
@@ -110,8 +110,8 @@ def __get_object(self, data):
110110
return Step(
111111
"{}/steps/{}".format(self.url, data["uuid"]),
112112
data,
113-
**self._new_session_args,
114-
)
113+
**self._new_session_args
114+
) # fmt: skip
115115

116116
@property
117117
def uuid(self):
@@ -146,8 +146,8 @@ def pullrequest(self):
146146
return PullRequest(
147147
target["pullrequest"]["links"]["self"]["href"],
148148
target["pullrequest"],
149-
**self._new_session_args,
150-
)
149+
**self._new_session_args
150+
) # fmt: skip
151151
else:
152152
return None
153153

atlassian/bitbucket/cloud/repositories/repositoryVariables.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ def __get_object(self, data):
1111
return RepositoryVariable(
1212
self.url_joiner(self.url, data["uuid"]),
1313
data,
14-
**self._new_session_args,
15-
)
14+
**self._new_session_args
15+
) # fmt: skip
1616

1717
def create(self, key, value, secured):
1818
"""

0 commit comments

Comments
 (0)