From 0509c81975df7adfd9f45005d534ef187d567bb5 Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Fri, 24 Mar 2023 14:23:13 +0100 Subject: [PATCH] Fix black and cover errors Change-Id: I2aa8b562c5dace026a0ad375a1246aa503cc1b73 Signed-off-by: garciadeblas --- osm_common/fsmongo.py | 3 --- .../fixing_black_errors-ac95adca43cf884c.yaml | 27 +++++++++++++++++++ tox.ini | 8 +++--- 3 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 releasenotes/notes/fixing_black_errors-ac95adca43cf884c.yaml diff --git a/osm_common/fsmongo.py b/osm_common/fsmongo.py index 727410e..2b67cf3 100644 --- a/osm_common/fsmongo.py +++ b/osm_common/fsmongo.py @@ -570,7 +570,6 @@ class FsMongo(FsBase): self.__update_local_fs(from_path=from_path) def _update_mongo_fs(self, from_path): - os_path = self.path + from_path # Obtain list of files and dirs in filesystem @@ -615,7 +614,6 @@ class FsMongo(FsBase): remote_files.pop(rel_filename, None) if last_modified_date >= upload_date: - stream = None fh = None try: @@ -652,7 +650,6 @@ class FsMongo(FsBase): self.fs.delete(file._id) def _get_mongo_files(self, from_path=None): - file_dict = {} file_cursor = self.fs.find(no_cursor_timeout=True, sort=[("uploadDate", -1)]) for file in file_cursor: diff --git a/releasenotes/notes/fixing_black_errors-ac95adca43cf884c.yaml b/releasenotes/notes/fixing_black_errors-ac95adca43cf884c.yaml new file mode 100644 index 0000000..6a068c9 --- /dev/null +++ b/releasenotes/notes/fixing_black_errors-ac95adca43cf884c.yaml @@ -0,0 +1,27 @@ +####################################################################################### +# Copyright ETSI Contributors and Others. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +####################################################################################### +--- +other: + - | + Fixing black and cover errors in common v12.0 + + The update of the version of black is detecting + new issues taht this commit addresses. + + The use of whitelist_externals in tox.ini has been + replaced by allowlist_externals, with the new version + of tox. This will allow cover tests to pass diff --git a/tox.ini b/tox.ini index 3a5b32b..2a8e6f6 100644 --- a/tox.ini +++ b/tox.ini @@ -48,7 +48,7 @@ commands = coverage report --omit='*tests*' coverage html -d ./cover --omit='*tests*' coverage xml -o coverage.xml --omit=*tests* -whitelist_externals = sh +allowlist_externals = sh ####################################################################################### [testenv:flake8] @@ -80,7 +80,7 @@ commands = [testenv:pip-compile] deps = pip-tools==6.6.2 skip_install = true -whitelist_externals = bash +allowlist_externals = bash [ commands = - bash -c "for file in requirements*.in ; do \ @@ -103,13 +103,13 @@ commands = python3 setup.py --command-packages=stdeb.command sdist_dsc sh -c 'cd deb_dist/osm-common*/ && dpkg-buildpackage -rfakeroot -uc -us' sh -c 'rm osm_common/requirements.txt' -whitelist_externals = sh +allowlist_externals = sh ####################################################################################### [testenv:release_notes] deps = reno skip_install = true -whitelist_externals = bash +allowlist_externals = bash commands = reno new {posargs:new_feature} bash -c "sed -i -e '1 e head -16 tox.ini' releasenotes/notes/{posargs:new_feature}*.yaml" -- 2.25.1