Skip to content

Commit 08a4c64

Browse files
committed
future annotations aren't available in 3.6
1 parent 2969f6d commit 08a4c64

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

atlassian/bitbucket/cloud/repositories/repositoryVariables.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
# coding=utf-8
2-
from __future__ import annotations
32
from ..base import BitbucketCloudBase
43

54

65
class RepositoryVariables(BitbucketCloudBase):
76
def __init__(self, url, *args, **kwargs):
87
super(RepositoryVariables, self).__init__(url, *args, **kwargs)
98

10-
def __get_object(self, data) -> RepositoryVariable:
9+
def __get_object(self, data) -> "RepositoryVariable":
1110
return RepositoryVariable(
1211
self.url_joiner(self.url, data["uuid"]),
1312
data,

atlassian/jira.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
# coding=utf-8
2-
from typing_extensions import Literal
32
import logging
43
import os
54
import re
6-
from typing import TYPE_CHECKING, Any, BinaryIO, cast, Optional, Union, Dict, List
5+
from typing import Any, BinaryIO, Dict, List, Optional, Union, cast
76
from warnings import warn
87

98
from deprecated import deprecated
109
from requests import HTTPError, Response
10+
from typing_extensions import Literal
1111

1212
from .errors import ApiNotFoundError, ApiPermissionError
1313
from .rest_client import AtlassianRestAPI
14-
15-
if TYPE_CHECKING:
16-
from .typehints import T_id, T_resp_json
14+
from .typehints import T_id, T_resp_json
1715

1816
log = logging.getLogger(__name__)
1917

@@ -234,7 +232,7 @@ def get_application_role(self, role_key: str) -> T_resp_json:
234232
def get_attachments_ids_from_issue(self, issue: T_id) -> List[Dict[str, str]]:
235233
"""
236234
Get attachments IDs from jira issue
237-
:param jira issue key: str
235+
:param issue: str jira issue key
238236
:return: list of integers attachment IDs
239237
"""
240238
issue_id = self.get_issue(issue)["fields"]["attachment"]
@@ -512,7 +510,7 @@ def issue_get_comments(self, issue_id: T_id) -> T_resp_json:
512510
def issues_get_comments_by_id(self, *args: int) -> T_resp_json:
513511
"""
514512
Get Comments on Multiple Issues
515-
:param *args: int Issue ID's
513+
:param args: int Issue ID's
516514
:raises: requests.exceptions.HTTPError
517515
:return:
518516
"""
@@ -1431,7 +1429,7 @@ def get_issue_labels(self, issue_key: str) -> T_resp_json:
14311429

14321430
def update_issue(self, issue_key: T_id, update: Union[str, dict]) -> T_resp_json:
14331431
"""
1434-
:param issue: the issue to update
1432+
:param issue_key: the issue to update
14351433
:param update: the update to make
14361434
:return: True if successful, False if not
14371435
"""
@@ -1440,7 +1438,7 @@ def update_issue(self, issue_key: T_id, update: Union[str, dict]) -> T_resp_json
14401438

14411439
def label_issue(self, issue_key: T_id, labels: list):
14421440
"""
1443-
:param issue: the issue to update
1441+
:param issue_key: the issue to update
14441442
:param labels: the labels to add
14451443
:return: True if successful, False if not
14461444
"""
@@ -1485,7 +1483,7 @@ def issue_exists(self, issue_key: str) -> Optional[bool]:
14851483
original_value = self.advanced_mode
14861484
self.advanced_mode = True
14871485
try:
1488-
resp = self.issue(issue_key, fields="*none")
1486+
resp = cast(Response, self.issue(issue_key, fields="*none"))
14891487
if resp.status_code == 404:
14901488
log.info('Issue "%s" does not exists', issue_key)
14911489
return False

tests/test_confluence_advanced_mode.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# coding=utf-8
2-
from __future__ import annotations
3-
42
import json
53
import os
64
import unittest

0 commit comments

Comments
 (0)