From 24d3ce464ac7366a3683b318a7c64de151feb3d3 Mon Sep 17 00:00:00 2001 From: REANA team Date: Wed, 30 Mar 2022 13:56:08 +0200 Subject: [PATCH] global: upgrade black formatter version --- .github/workflows/ci.yml | 4 ++-- docs/conf.py | 5 ++++- reana_job_controller/job_monitor.py | 10 +++++---- .../kubernetes_job_manager.py | 4 +++- reana_job_controller/spec.py | 5 ++++- requirements.txt | 4 ++-- run-tests.sh | 4 ++-- setup.py | 22 ++++++++++++++----- 8 files changed, 39 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7844b0a5..25f69d25 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,5 @@ # This file is part of REANA. -# Copyright (C) 2020 CERN. +# Copyright (C) 2020, 2022 CERN. # # REANA is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. @@ -34,7 +34,7 @@ jobs: - name: Check Python code formatting run: | pip install --upgrade pip - pip install black==19.10b0 + pip install black ./run-tests.sh --check-black lint-flake8: diff --git a/docs/conf.py b/docs/conf.py index f4dff414..389bae5e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -62,7 +62,10 @@ "page": "_static/api", "spec": "openapi.json", "embed": True, - "opts": {"hide-loading": True, "hide-hostname": True,}, + "opts": { + "hide-loading": True, + "hide-hostname": True, + }, } ] diff --git a/reana_job_controller/job_monitor.py b/reana_job_controller/job_monitor.py index 211befe1..2441c62b 100644 --- a/reana_job_controller/job_monitor.py +++ b/reana_job_controller/job_monitor.py @@ -212,10 +212,12 @@ def _get_containers_logs(self, job_pod) -> Optional[str]: logging.info(f"Grabbing pod {job_pod.metadata.name} logs ...") for container in container_statuses: if container.state.terminated: - container_log = current_k8s_corev1_api_client.read_namespaced_pod_log( - namespace=REANA_RUNTIME_KUBERNETES_NAMESPACE, - name=job_pod.metadata.name, - container=container.name, + container_log = ( + current_k8s_corev1_api_client.read_namespaced_pod_log( + namespace=REANA_RUNTIME_KUBERNETES_NAMESPACE, + name=job_pod.metadata.name, + container=container.name, + ) ) pod_logs += "{}: :\n {}\n".format(container.name, container_log) if hasattr(container.state.terminated, "reason"): diff --git a/reana_job_controller/kubernetes_job_manager.py b/reana_job_controller/kubernetes_job_manager.py index 0d657da2..525b420d 100644 --- a/reana_job_controller/kubernetes_job_manager.py +++ b/reana_job_controller/kubernetes_job_manager.py @@ -313,7 +313,9 @@ def add_memory_limit(self, job_spec): def _set_job_memory_limit(job_spec, memory_limit): job_spec["containers"][0]["resources"] = { - "limits": {"memory": memory_limit,} + "limits": { + "memory": memory_limit, + } } if self.kubernetes_memory_limit: diff --git a/reana_job_controller/spec.py b/reana_job_controller/spec.py index e510cde3..feca3f2c 100644 --- a/reana_job_controller/spec.py +++ b/reana_job_controller/spec.py @@ -22,7 +22,10 @@ def build_openapi_spec(): title="reana-job-controller", version=__version__, info=dict(description="REANA Job Controller API"), - plugins=["apispec.ext.flask", "apispec.ext.marshmallow",], + plugins=[ + "apispec.ext.flask", + "apispec.ext.marshmallow", + ], ) # Add marshmallow models to specification diff --git a/requirements.txt b/requirements.txt index e29b7550..17e1ba37 100644 --- a/requirements.txt +++ b/requirements.txt @@ -53,8 +53,8 @@ pyrsistent==0.18.0 # via jsonschema python-dateutil==2.8.2 # via bravado, bravado-core, kubernetes pytz==2021.3 # via bravado-core, fs pyyaml==5.4.1 # via apispec, bravado, bravado-core, kubernetes, reana-commons, swagger-spec-validator -reana-commons[kubernetes]==0.9.0a5 # via reana-db, reana-job-controller (setup.py) -reana-db==0.9.0a4 # via reana-job-controller (setup.py) +reana-commons[kubernetes]==0.9.0a6 # via reana-db, reana-job-controller (setup.py) +reana-db==0.9.0a5 # via reana-job-controller (setup.py) requests-oauthlib==1.3.0 # via kubernetes requests==2.26.0 # via bravado, kubernetes, requests-oauthlib retrying==1.3.3 # via reana-job-controller (setup.py) diff --git a/run-tests.sh b/run-tests.sh index 08789943..da5d0f7b 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -1,7 +1,7 @@ #!/bin/bash # # This file is part of REANA. -# Copyright (C) 2017, 2018, 2020, 2021 CERN. +# Copyright (C) 2017, 2018, 2020, 2021, 2022 CERN. # # REANA is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. @@ -123,7 +123,7 @@ check_all_darwin () { apt update && apt-get -y install libkrb5-dev git shellcheck && pip install -r requirements.txt && pip install -e .[all] && # Install test dependencies - pip install black==19.10b0 && + pip install black && pip install flake8 && pip install pydocstyle && pip install check-manifest && diff --git a/setup.py b/setup.py index d4b252df..65cb5991 100644 --- a/setup.py +++ b/setup.py @@ -19,11 +19,15 @@ history = open("CHANGES.rst").read() tests_require = [ - "pytest-reana>=0.9.0a1,<0.10.0", + "pytest-reana>=0.9.0a4,<0.10.0", ] extras_require = { - "debug": ["wdb", "ipdb", "Flask-DebugToolbar",], + "debug": [ + "wdb", + "ipdb", + "Flask-DebugToolbar", + ], "docs": [ "Sphinx>=1.5.1,<1.6", "sphinx-rtd-theme>=0.1.9", @@ -55,8 +59,8 @@ "Werkzeug>=1.0.1,<2.0", "fs>=2.0", "marshmallow>2.13.0,<=2.20.1", - "reana-commons[kubernetes]>=0.9.0a5,<0.10.0", - "reana-db>=0.9.0a4,<0.10.0", + "reana-commons[kubernetes]>=0.9.0a6,<0.10.0", + "reana-db>=0.9.0a5,<0.10.0", "htcondor==8.9.11", "retrying>=1.3.3", ] @@ -78,9 +82,15 @@ author="REANA", author_email="info@reana.io", url="https://github.com/reanahub/reana-job-controller", - packages=["reana_job_controller",], + packages=[ + "reana_job_controller", + ], zip_safe=False, - entry_points={"flask.commands": ["openapi = reana_job_controller.cli:openapi",],}, + entry_points={ + "flask.commands": [ + "openapi = reana_job_controller.cli:openapi", + ], + }, extras_require=extras_require, install_requires=install_requires, setup_requires=setup_requires,