Skip to content

Commit 0c2a7df

Browse files
authored
[Tests] Remove Travis CI (atlassian-api#627)
- Extend GitHub actisons with python3.9 and python-dev (apt-get doesn't know 3.10-dev). - Need to switch to Upuntu 20.04 and gcc-8 to use python3.9. Redo atlassian-api#626 because of merge problems on master: - Move content of pylintrc to pyproject.toml. - Configure the line length to 120 also for black. - Apply formating and fix flake8 error.
1 parent a221cb1 commit 0c2a7df

File tree

69 files changed

+730
-1468
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+730
-1468
lines changed

.github/workflows/test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ jobs:
1414
run-docker:
1515

1616
runs-on: ubuntu-18.04
17-
17+
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
python-version: ['3.4', '3.5', '3.6', '3.7', '3.8']
21+
python-version: ['3.4', '3.5', '3.6', '3.7', '3.8', '3.9', '-dev']
2222

2323
steps:
2424
- uses: actions/checkout@v2

.travis.yml

-20
This file was deleted.

Dockerfile.qa

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
FROM ubuntu:18.04
1+
FROM ubuntu:20.04
22

33
ARG PYTHON_VERSION
44

55
RUN \
66
apt update && \
7-
apt-get install -y make gcc-5 libkrb5-dev python$PYTHON_VERSION python3-pip && \
7+
apt-get install -y make gcc-8 libkrb5-dev python$PYTHON_VERSION python3-pip && \
88
apt-get clean
99

1010
WORKDIR /atlassian-python-api

Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ setup-dev:
3131

3232
qa: tox
3333

34+
tox: export PYTHONDONTWRITEBYTECODE := 1
35+
3436
tox:
3537
tox
3638

atlassian/bamboo.py

+16-63
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,7 @@ def _get_generator(
6666
yield response
6767

6868
def base_list_call(
69-
self,
70-
resource,
71-
expand,
72-
favourite,
73-
clover_enabled,
74-
max_results,
75-
label=None,
76-
start_index=0,
77-
**kwargs
69+
self, resource, expand, favourite, clover_enabled, max_results, label=None, start_index=0, **kwargs
7870
):
7971
flags = []
8072
params = {"max-results": max_results}
@@ -101,9 +93,7 @@ def base_list_call(
10193

10294
""" Projects & Plans """
10395

104-
def projects(
105-
self, expand=None, favourite=False, clover_enabled=False, max_results=25
106-
):
96+
def projects(self, expand=None, favourite=False, clover_enabled=False, max_results=25):
10797
return self.base_list_call(
10898
"project",
10999
expand=expand,
@@ -217,9 +207,7 @@ def enable_plan(self, plan_key):
217207

218208
""" Branches """
219209

220-
def search_branches(
221-
self, plan_key, include_default_branch=True, max_results=25, start=0
222-
):
210+
def search_branches(self, plan_key, include_default_branch=True, max_results=25, start=0):
223211
params = {
224212
"max-result": max_results,
225213
"start-index": start,
@@ -261,9 +249,7 @@ def get_branch_info(self, plan_key, branch_name):
261249
:param branch_name:
262250
:return:
263251
"""
264-
resource = "plan/{plan_key}/branch/{branch_name}".format(
265-
plan_key=plan_key, branch_name=branch_name
266-
)
252+
resource = "plan/{plan_key}/branch/{branch_name}".format(plan_key=plan_key, branch_name=branch_name)
267253
return self.get(self.resource_url(resource))
268254

269255
def create_branch(
@@ -286,9 +272,7 @@ def create_branch(
286272
:param cleanup_enabled: bool
287273
:return: PUT request
288274
"""
289-
resource = "plan/{plan_key}/branch/{branch_name}".format(
290-
plan_key=plan_key, branch_name=branch_name
291-
)
275+
resource = "plan/{plan_key}/branch/{branch_name}".format(plan_key=plan_key, branch_name=branch_name)
292276
params = {}
293277
if vcs_branch:
294278
params = dict(
@@ -350,9 +334,7 @@ def results(
350334
"""
351335
resource = "result"
352336
if project_key and plan_key and job_key and build_number:
353-
resource += "/{}-{}-{}/{}".format(
354-
project_key, plan_key, job_key, build_number
355-
)
337+
resource += "/{}-{}-{}/{}".format(project_key, plan_key, job_key, build_number)
356338
elif project_key and plan_key and build_number:
357339
resource += "/{}-{}/{}".format(project_key, plan_key, build_number)
358340
elif project_key and plan_key:
@@ -489,9 +471,7 @@ def plan_results(
489471
include_all_states=include_all_states,
490472
)
491473

492-
def build_result(
493-
self, build_key, expand=None, include_all_states=False, start=0, max_results=25
494-
):
474+
def build_result(self, build_key, expand=None, include_all_states=False, start=0, max_results=25):
495475
"""
496476
Returns details of a specific build result
497477
:param expand: expands build result details on request. Possible values are: artifacts, comments, labels,
@@ -516,9 +496,7 @@ def build_result(
516496
include_all_states=include_all_states,
517497
)
518498
except ValueError:
519-
raise ValueError(
520-
'The key "{}" does not correspond to a build result'.format(build_key)
521-
)
499+
raise ValueError('The key "{}" does not correspond to a build result'.format(build_key))
522500

523501
def build_latest_result(self, plan_key, expand=None, include_all_states=False):
524502
"""
@@ -541,11 +519,7 @@ def build_latest_result(self, plan_key, expand=None, include_all_states=False):
541519
include_all_states=include_all_states,
542520
)
543521
except ValueError:
544-
raise ValueError(
545-
'The key "{}" does not correspond to the latest build result'.format(
546-
plan_key
547-
)
548-
)
522+
raise ValueError('The key "{}" does not correspond to the latest build result'.format(plan_key))
549523

550524
def delete_build_result(self, build_key):
551525
"""
@@ -557,18 +531,9 @@ def delete_build_result(self, build_key):
557531
plan_key = "{}-{}".format(build_key[0], build_key[1])
558532
build_number = build_key[2]
559533
params = {"buildKey": plan_key, "buildNumber": build_number}
560-
return self.post(
561-
custom_resource, params=params, headers=self.form_token_headers
562-
)
534+
return self.post(custom_resource, params=params, headers=self.form_token_headers)
563535

564-
def execute_build(
565-
self,
566-
plan_key,
567-
stage=None,
568-
execute_all_stages=True,
569-
custom_revision=None,
570-
**bamboo_variables
571-
):
536+
def execute_build(self, plan_key, stage=None, execute_all_stages=True, custom_revision=None, **bamboo_variables):
572537
"""
573538
Fire build execution for specified plan.
574539
!IMPORTANT! NOTE: for some reason, this method always execute all stages
@@ -604,9 +569,7 @@ def stop_build(self, plan_key):
604569

605570
""" Comments & Labels """
606571

607-
def comments(
608-
self, project_key, plan_key, build_number, start_index=0, max_results=25
609-
):
572+
def comments(self, project_key, plan_key, build_number, start_index=0, max_results=25):
610573
resource = "result/{}-{}-{}/comment".format(project_key, plan_key, build_number)
611574
params = {"start-index": start_index, "max-results": max_results}
612575
return self.get(self.resource_url(resource), params=params)
@@ -619,9 +582,7 @@ def create_comment(self, project_key, plan_key, build_number, comment, author=No
619582
}
620583
return self.post(self.resource_url(resource), data=comment_data)
621584

622-
def labels(
623-
self, project_key, plan_key, build_number, start_index=0, max_results=25
624-
):
585+
def labels(self, project_key, plan_key, build_number, start_index=0, max_results=25):
625586
resource = "result/{}-{}-{}/label".format(project_key, plan_key, build_number)
626587
params = {"start-index": start_index, "max-results": max_results}
627588
return self.get(self.resource_url(resource), params=params)
@@ -631,9 +592,7 @@ def create_label(self, project_key, plan_key, build_number, label):
631592
return self.post(self.resource_url(resource), data={"name": label})
632593

633594
def delete_label(self, project_key, plan_key, build_number, label):
634-
resource = "result/{}-{}-{}/label/{}".format(
635-
project_key, plan_key, build_number, label
636-
)
595+
resource = "result/{}-{}-{}/label/{}".format(project_key, plan_key, build_number, label)
637596
return self.delete(self.resource_url(resource))
638597

639598
def get_projects(self):
@@ -667,9 +626,7 @@ def deployment_project(self, project_id):
667626
return self.get(self.resource_url(resource))
668627

669628
def deployment_environment_results(self, env_id, expand=None, max_results=25):
670-
resource = "deploy/environment/{environmentId}/results".format(
671-
environmentId=env_id
672-
)
629+
resource = "deploy/environment/{environmentId}/results".format(environmentId=env_id)
673630
params = {"max-result": max_results, "start-index": 0}
674631
size = 1
675632
if expand:
@@ -686,11 +643,7 @@ def deployment_dashboard(self, project_id=None):
686643
Returns the current status of each deployment environment
687644
If no project id is provided, returns all projects.
688645
"""
689-
resource = (
690-
"deploy/dashboard/{}".format(project_id)
691-
if project_id
692-
else "deploy/dashboard"
693-
)
646+
resource = "deploy/dashboard/{}".format(project_id) if project_id else "deploy/dashboard"
694647
return self.get(self.resource_url(resource))
695648

696649
""" Users & Groups """

0 commit comments

Comments
 (0)