Pin black, flake and pylint versions in tox.ini 73/14173/1
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Mon, 29 Jan 2024 15:28:37 +0000 (16:28 +0100)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Mon, 29 Jan 2024 15:28:37 +0000 (16:28 +0100)
Change-Id: Ibc788448bf70586f1cc75078333552d5559d3a36
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
osmclient/cli_commands/rbac.py
osmclient/common/sol004_package.py
osmclient/common/sol007_package.py
osmclient/sol005/osmrepo.py
tox.ini

index 4e1680d..71fa12b 100755 (executable)
@@ -294,9 +294,9 @@ def project_update(ctx, project, name, quotas):
     "--projects",
     # prompt="Comma separate list of projects",
     multiple=True,
-    callback=lambda ctx, param, value: "".join(value).split(",")
-    if all(len(x) == 1 for x in value)
-    else value,
+    callback=lambda ctx, param, value: (
+        "".join(value).split(",") if all(len(x) == 1 for x in value) else value
+    ),
     help="list of project ids that the user belongs to",
 )
 @click.option(
@@ -470,12 +470,14 @@ def user_list(ctx, filter):
                     user["username"],
                     user["_id"],
                     user["_admin"]["user_status"].upper(),
-                    time.strftime(
-                        "%b-%d-%Y %X",
-                        time.gmtime(user["_admin"]["account_expire_time"]),
-                    )
-                    if not user["username"] == "admin"
-                    else user["_admin"]["account_expire_time"],
+                    (
+                        time.strftime(
+                            "%b-%d-%Y %X",
+                            time.gmtime(user["_admin"]["account_expire_time"]),
+                        )
+                        if not user["username"] == "admin"
+                        else user["_admin"]["account_expire_time"]
+                    ),
                 ]
             )
     else:
index b585bc4..fe480fc 100644 (file)
@@ -103,9 +103,9 @@ class SOL004Package(SOLPackage):
             self._manifest_metadata[self._MANIFEST_VNFD_PROVIDER_ID] = vnfd_data.get(
                 "provider", "OSM"
             )
-            self._manifest_metadata[
-                self._MANIFEST_VNFD_SOFTWARE_VERSION
-            ] = vnfd_data.get("version", "1.0")
+            self._manifest_metadata[self._MANIFEST_VNFD_SOFTWARE_VERSION] = (
+                vnfd_data.get("version", "1.0")
+            )
             self._manifest_metadata[self._MANIFEST_VNFD_PACKAGE_VERSION] = "1.0.0"
             self._manifest_metadata[self._MANIFEST_VNFD_RELEASE_DATE_TIME] = (
                 datetime.datetime.now().astimezone().isoformat()
index 3c1df3a..6237f8c 100644 (file)
@@ -99,9 +99,9 @@ class SOL007Package(SOLPackage):
             self._manifest_metadata[self._MANIFEST_NSD_DESIGNER] = nsd_data.get(
                 "designer", "OSM"
             )
-            self._manifest_metadata[
-                self._MANIFEST_NSD_FILE_STRUCTURE_VERSION
-            ] = nsd_data.get("version", "1.0")
+            self._manifest_metadata[self._MANIFEST_NSD_FILE_STRUCTURE_VERSION] = (
+                nsd_data.get("version", "1.0")
+            )
             self._manifest_metadata[self._MANIFEST_NSD_RELEASE_DATE_TIME] = (
                 datetime.datetime.now().astimezone().isoformat()
             )
index 6b9d527..add5c18 100644 (file)
@@ -531,9 +531,9 @@ class OSMRepo(Repo):
             index["{}_packages".format(package_type)][fields.get("id")] = {
                 fields.get("version"): data_ind
             }
-            index["{}_packages".format(package_type)][fields.get("id")][
-                "latest"
-            ] = fields.get("version")
+            index["{}_packages".format(package_type)][fields.get("id")]["latest"] = (
+                fields.get("version")
+            )
             yaml.safe_dump(
                 index,
                 open(join(destination, "index.yaml"), "w"),
diff --git a/tox.ini b/tox.ini
index e1560bb..f822051 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -31,7 +31,7 @@ parallel_show_output = true
 
 #######################################################################################
 [testenv:black]
-deps = black
+deps = black==24.1.1
 skip_install = true
 commands =
         black --check --diff osmclient/
@@ -54,7 +54,7 @@ allowlist_externals = sh
 
 #######################################################################################
 [testenv:flake8]
-deps = flake8
+deps = flake8==7.0.0
 commands =
         flake8 osmclient/ setup.py
 
@@ -64,7 +64,7 @@ commands =
 deps =  {[testenv]deps}
         -r{toxinidir}/requirements-dev.txt
         -r{toxinidir}/requirements-test.txt
-        pylint
+        pylint==3.0.3
 commands =
         pylint -E osmclient/