brynq-sdk-jira 2.1.0__tar.gz → 2.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.0
2
2
  Name: brynq_sdk_jira
3
- Version: 2.1.0
3
+ Version: 2.1.1
4
4
  Summary: JIRA wrapper from BrynQ
5
5
  Home-page: UNKNOWN
6
6
  Author: BrynQ
@@ -14,6 +14,7 @@ class Jira(BrynQ):
14
14
  "Content-Type": "application/json"
15
15
  }
16
16
  self.debug = debug
17
+ self.timeout = 3600
17
18
 
18
19
  def get_issues(self, jql_filter: str = None, jira_filter_id: int = None, get_extra_fields: list = None, expand_fields: list = None) -> pd.DataFrame:
19
20
  """
@@ -46,7 +47,7 @@ class Jira(BrynQ):
46
47
  url = f"{self.base_url}rest/api/3/search/jira/filter/{jira_filter_id}"
47
48
  else:
48
49
  url = f"{self.base_url}rest/api/3/search"
49
- response = requests.post(url=url, headers=self.headers, data=json.dumps(query))
50
+ response = requests.post(url=url, headers=self.headers, data=json.dumps(query), timeout=self.timeout)
50
51
  if response.status_code == 200:
51
52
  response_json = response.json()
52
53
  no_of_loops += 1
@@ -79,7 +80,7 @@ class Jira(BrynQ):
79
80
  }
80
81
  if self.debug:
81
82
  print(query)
82
- response = requests.get(f"{self.base_url}rest/api/3/project/search", headers=self.headers, params=query)
83
+ response = requests.get(f"{self.base_url}rest/api/3/project/search", headers=self.headers, params=query, timeout=self.timeout)
83
84
  if response.status_code == 200:
84
85
  response_json = response.json()
85
86
  response.raise_for_status()
@@ -103,7 +104,7 @@ class Jira(BrynQ):
103
104
  :return: A dataframe with the versions.
104
105
  """
105
106
  url = f"{self.base_url}rest/api/latest/project/{project_key}/versions"
106
- response = requests.get(url=url, headers=self.headers)
107
+ response = requests.get(url=url, headers=self.headers, timeout=self.timeout)
107
108
  if response.status_code == 200:
108
109
  response_json = response.json()
109
110
  df = pd.json_normalize(response_json)
@@ -123,7 +124,7 @@ class Jira(BrynQ):
123
124
  all_users = []
124
125
 
125
126
  while True:
126
- response = requests.get(f"{self.base_url}rest/api/3/users/search?startAt={start_at}&maxResults={max_results}", headers=self.headers)
127
+ response = requests.get(f"{self.base_url}rest/api/3/users/search?startAt={start_at}&maxResults={max_results}", headers=self.headers, timeout=self.timeout)
127
128
  response.raise_for_status()
128
129
  if response.status_code == 200:
129
130
  users = response.json() # A list of user objects
@@ -16,6 +16,7 @@ class Tempo(BrynQ):
16
16
  }
17
17
  if self.debug:
18
18
  print(self.headers)
19
+ self.timeout = 3600
19
20
 
20
21
  def get_tempo_hours(self, from_date: str = None, to_date: str = None, updated_from: str = None) -> json:
21
22
  """
@@ -39,7 +40,7 @@ class Tempo(BrynQ):
39
40
 
40
41
  while not got_all_results:
41
42
  loop_parameters = parameters | {"limit": 1000, "offset": 1000 * no_of_loops}
42
- response = requests.get('https://api.tempo.io/4/worklogs', headers=self.headers, params=loop_parameters)
43
+ response = requests.get('https://api.tempo.io/4/worklogs', headers=self.headers, params=loop_parameters, timeout=self.timeout)
43
44
  if response.status_code == 200:
44
45
  response_json = response.json()
45
46
  no_of_loops += 1
@@ -78,7 +79,7 @@ class Tempo(BrynQ):
78
79
 
79
80
  while not got_all_results:
80
81
  parameters["offset"] = 1000 * no_of_loops
81
- response = requests.get('https://api.tempo.io/4/teams', headers=self.headers, params=parameters)
82
+ response = requests.get('https://api.tempo.io/4/teams', headers=self.headers, params=parameters, timeout=self.timeout)
82
83
  if response.status_code == 200:
83
84
  response_json = response.json()
84
85
  total_response.extend(response_json["results"])
@@ -106,7 +107,7 @@ class Tempo(BrynQ):
106
107
 
107
108
  while not got_all_results:
108
109
  parameters = {"limit": 1000, "offset": 1000 * no_of_loops}
109
- response = requests.get(f'https://api.tempo.io/4/teams/{team_id}/members', headers=self.headers, params=parameters)
110
+ response = requests.get(f'https://api.tempo.io/4/teams/{team_id}/members', headers=self.headers, params=parameters, timeout=self.timeout)
110
111
  if response.status_code == 200:
111
112
  response_json = response.json()
112
113
  total_response.extend(response_json["results"])
@@ -132,7 +133,7 @@ class Tempo(BrynQ):
132
133
 
133
134
  while not got_all_results:
134
135
  loop_parameters = parameters | {"limit": 1000, "offset": 1000 * no_of_loops}
135
- response = requests.get('https://api.tempo.io/4/accounts', headers=self.headers, params=loop_parameters)
136
+ response = requests.get('https://api.tempo.io/4/accounts', headers=self.headers, params=loop_parameters, timeout=self.timeout)
136
137
  if response.status_code == 200:
137
138
  response_json = response.json()
138
139
  no_of_loops += 1
@@ -168,7 +169,7 @@ class Tempo(BrynQ):
168
169
 
169
170
  while not got_all_results:
170
171
  loop_parameters = parameters | {"limit": 1000, "offset": 1000 * no_of_loops}
171
- response = requests.get(f"https://api.tempo.io/4/worklogs/account/{account_key}", headers=self.headers, params=loop_parameters)
172
+ response = requests.get(f"https://api.tempo.io/4/worklogs/account/{account_key}", headers=self.headers, params=loop_parameters, timeout=self.timeout)
172
173
  if response.status_code == 200:
173
174
  response_json = response.json()
174
175
  total_response.extend(response_json.get("results", []))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.0
2
2
  Name: brynq-sdk-jira
3
- Version: 2.1.0
3
+ Version: 2.1.1
4
4
  Summary: JIRA wrapper from BrynQ
5
5
  Home-page: UNKNOWN
6
6
  Author: BrynQ
@@ -2,7 +2,7 @@ from setuptools import setup, find_namespace_packages
2
2
 
3
3
  setup(
4
4
  name='brynq_sdk_jira',
5
- version='2.1.0',
5
+ version='2.1.1',
6
6
  description='JIRA wrapper from BrynQ',
7
7
  long_description='JIRA wrapper from BrynQ',
8
8
  author='BrynQ',
File without changes