Skip to content

Commit 22df592

Browse files
author
Gonchik Tsymzhitov
committed
Bump version. Add deprecated marker for typo method names
1 parent 79f541b commit 22df592

File tree

13 files changed

+39
-29
lines changed

13 files changed

+39
-29
lines changed

.github/bump_version

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ if [[ ( -z ${1+x} ) || ( -z ${2+x} ) ]]; then
1313
1414
Expects arguments:
1515
- repo: the relative/absolute path to the repository
16-
- increment: (major|minor|patch) part of the version to increase, default is patch
16+
- increment: (major|minor|patch) part of the version to INCREASE, default is patch
1717
EOF
1818
exit 1
1919
fi
2020

21-
repo_path=${1}
22-
increase=${2:patch}
21+
REPO_PATH=${1}
22+
INCREASE=${2:patch}
2323

2424

2525
function autoversion(){
@@ -30,7 +30,7 @@ function autoversion(){
3030
BUILD_NUMBER="0" # In the developer machine, this will build x.y.z.dev0
3131
fi
3232

33-
cd ${repo_path}
33+
cd ${REPO_PATH} || exit 1
3434

3535
git fetch --tags 2>/dev/null
3636
last_tag=$(git tag | sort -Vr | head -1)
@@ -40,7 +40,7 @@ function autoversion(){
4040
echo "0.1.0.dev${BUILD_NUMBER}"
4141
else
4242
a=( ${last_tag//./ } ) # replace points, split into array
43-
case ${increase} in
43+
case ${INCREASE} in
4444
patch)
4545
((a[2]++))
4646
;;

atlassian/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.4.1
1+
2.4.2

atlassian/bitbucket/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,10 +1426,10 @@ def update_pull_request_comment(
14261426
data = {"version": comment_version, "text": comment}
14271427
return self.put(url, data=data)
14281428

1429-
@deprecated
1429+
@deprecated(version="2.4.2", reason="Use delete_pull_request_comment()")
14301430
def delete_pull_reques_comment(self, project_key, repository_slug, pull_request_id, comment_id, comment_version):
14311431
"""
1432-
Typo will be removed
1432+
Deprecated name since 2.4.2. Let's use the get_pull_request()
14331433
"""
14341434
return self.delete_pull_request_comment(
14351435
project_key, repository_slug, pull_request_id, comment_id, comment_version

atlassian/bitbucket/cloud/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ def __init__(self, url, link="self", *args, **kwargs):
1010
"""
1111
Init the rest api wrapper
1212
:param url: The base url used for the rest api.
13-
:param link: Attribute to resolve a url based on input data. If None, no tries to receive an url from input data
13+
:param link: Attribute to resolve a url based on input data.
14+
If None, no tries to receive an url from input data
1415
:param *args: The fixed arguments for the AtlassianRestApi.
1516
:param **kwargs: The keyword arguments for the AtlassianRestApi.
1617

atlassian/bitbucket/server/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,23 @@ def __init__(self, url, *args, **kwargs):
2424
@property
2525
def groups(self):
2626
"""
27-
Property to access the global groups (https://docs.atlassian.com/bitbucket-server/rest/7.8.0/bitbucket-rest.html#idp62)
27+
Property to access the global groups
28+
Reference: https://docs.atlassian.com/bitbucket-server/rest/7.8.0/bitbucket-rest.html#idp62
2829
"""
2930
return self.__groups
3031

3132
@property
3233
def users(self):
3334
"""
34-
Property to access the global users (https://docs.atlassian.com/bitbucket-server/rest/7.8.0/bitbucket-rest.html#idp68)
35+
Property to access the global users
36+
Reference: https://docs.atlassian.com/bitbucket-server/rest/7.8.0/bitbucket-rest.html#idp68
3537
"""
3638
return self.__users
3739

3840
@property
3941
def projects(self):
4042
"""
41-
Property to access the projects (https://docs.atlassian.com/bitbucket-server/rest/7.8.0/bitbucket-rest.html#idp147)
43+
Property to access the projects
44+
Reference: https://docs.atlassian.com/bitbucket-server/rest/7.8.0/bitbucket-rest.html#idp147
4245
"""
4346
return self.__projects

atlassian/bitbucket/server/projects/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,20 +145,23 @@ def set_avatar(self, avatar):
145145
@property
146146
def groups(self):
147147
"""
148-
Property to access the project groups (https://docs.atlassian.com/bitbucket-server/rest/7.8.0/bitbucket-rest.html#idp158)
148+
Property to access the project groups
149+
Reference: https://docs.atlassian.com/bitbucket-server/rest/7.8.0/bitbucket-rest.html#idp158
149150
"""
150151
return self.__groups
151152

152153
@property
153154
def users(self):
154155
"""
155-
Property to access the project groups (https://docs.atlassian.com/bitbucket-server/rest/7.8.0/bitbucket-rest.html#idp164)
156+
Property to access the project groups
157+
Reference: https://docs.atlassian.com/bitbucket-server/rest/7.8.0/bitbucket-rest.html#idp164
156158
"""
157159
return self.__users
158160

159161
@property
160162
def repos(self):
161163
"""
162-
Property to access the repositories (https://docs.atlassian.com/bitbucket-server/rest/7.8.0/bitbucket-rest.html#idp173)
164+
Property to access the repositories
165+
Reference: https://docs.atlassian.com/bitbucket-server/rest/7.8.0/bitbucket-rest.html#idp173
163166
"""
164167
return self.__repos

atlassian/bitbucket/server/projects/repos/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,15 @@ def related(self):
217217
@property
218218
def groups(self):
219219
"""
220-
Property to access the project groups (https://docs.atlassian.com/bitbucket-server/rest/7.8.0/bitbucket-rest.html#idp279)
220+
Property to access the project groups:
221+
Reference: https://docs.atlassian.com/bitbucket-server/rest/7.8.0/bitbucket-rest.html#idp279
221222
"""
222223
return self.__groups
223224

224225
@property
225226
def users(self):
226227
"""
227-
Property to access the project groups (https://docs.atlassian.com/bitbucket-server/rest/7.8.0/bitbucket-rest.html#idp285)
228+
Property to access the project groups
229+
Reference: https://docs.atlassian.com/bitbucket-server/rest/7.8.0/bitbucket-rest.html#idp285
228230
"""
229231
return self.__users

atlassian/confluence.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import time
55

66
from requests import HTTPError
7-
7+
from deprecated import deprecated
88
from atlassian import utils
99
from .errors import (
1010
ApiError,
@@ -506,8 +506,9 @@ def get_all_draft_pages_from_space_through_cql(self, space, start=0, limit=500,
506506

507507
return response.get("results")
508508

509+
@deprecated(version="2.4.2", reason="Use get_all_restrictions_for_content()")
509510
def get_all_restictions_for_content(self, content_id):
510-
"""keep typo method"""
511+
"""Let's use the get_all_restrictions_for_content()"""
511512
log.warning("Please, be informed that is deprecated as typo naming")
512513
return self.get_all_restrictions_for_content(content_id=content_id)
513514

examples/bitbucket/bitbucket_check_last_auth_users.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ def report(all=False, non_auth=False, limit=20):
2525
else:
2626
full_date = None
2727
if full_date:
28-
output = f"{user.get('displayName')} ({user.get('emailAddress')}) authenticated on {full_date}"
28+
output = "{} ({}) authenticated on {}".format(user.get('displayName'), user.get('emailAddress'), full_date)
2929
if all:
3030
print(output)
3131
else:
32-
output = f"{user.get('displayName')} ({user.get('emailAddress')}) not authenticated yet"
32+
output = "{} ({}) not authenticated yet".format(user.get('displayName'), user.get('emailAddress'))
3333
if non_auth or all:
3434
print(output)
3535

examples/jira/jira_convert_group_members_into_user_in_role.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def convert_group_into_users_in_role(project_key, role_id, group_name):
1313
users = jira.get_all_users_from_group(group=group_name, limit=1000).get("values")
1414
for user in users:
1515
jira.add_user_into_project_role(project_key=project_key, role_id=role_id, user_name=user.get("name"))
16-
print(f"{user.get('name')} added into role_id {role_id} in {project_key}")
16+
print("{} added into role_id {} in {}".format(user.get('name'), role_id, project_key))
1717

1818

1919
group_name_to_find = "old-developers"
@@ -27,5 +27,5 @@ def convert_group_into_users_in_role(project_key, role_id, group_name):
2727
for member in members_of_role:
2828
if member.get("type") == "atlassian-group-role-actor":
2929
if member.get("name") == group_name_to_find:
30-
print(f'{project.get("key")} has {role.get("name")}')
30+
print('{} has {}'.format(project.get("key"), role.get("name")))
3131
convert_group_into_users_in_role(project.get("key"), role.get("id"), group_name_to_find)

0 commit comments

Comments
 (0)