From 4be442e2403efa355a0def9c9417d20c491284d9 Mon Sep 17 00:00:00 2001 From: Francis Charette-Migneault Date: Mon, 3 Oct 2022 17:18:05 -0400 Subject: [PATCH] security check workaround to ignore misbehaving bandit excludes not considered (relates to https://github.com/PyCQA/bandit/issues/657) --- Makefile | 3 ++- setup.cfg | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 56f861336..d391781a0 100644 --- a/Makefile +++ b/Makefile @@ -532,8 +532,9 @@ check-security-deps-only: mkdir-reports ## run security checks on package depen $(SAFETY_IGNORE) \ 1> >(tee "$(REPORTS_DIR)/check-security-deps.txt")' +# FIXME: bandit excludes not working (https://github.com/PyCQA/bandit/issues/657), clean-src beforehand to avoid error .PHONY: check-security-code-only -check-security-code-only: mkdir-reports ## run security checks on source code +check-security-code-only: mkdir-reports clean-src ## run security checks on source code @echo "Running security code checks..." @-rm -fr "$(REPORTS_DIR)/check-security-code.txt" @bash -c '$(CONDA_CMD) \ diff --git a/setup.cfg b/setup.cfg index 1f3745847..808cf8268 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,23 +5,23 @@ tag = True tag_name = {new_version} [bumpversion:file:CHANGES.rst] -search = +search = `Unreleased `_ (latest) ======================================================================== -replace = +replace = `Unreleased `_ (latest) ======================================================================== - + Changes: -------- - No change. - + Fixes: ------ - No change. - + .. _changes_{new_version}: - + `{new_version} `_ ({now:%%Y-%%m-%%d}) ======================================================================== @@ -42,14 +42,14 @@ search = LABEL version="{current_version}" replace = LABEL version="{new_version}" [tool:pytest] -addopts = +addopts = --strict-markers --tb=native weaver/ log_cli = false log_level = DEBUG python_files = test_*.py -markers = +markers = cli: mark test as related to CLI operations testbed14: mark test as 'testbed14' validation functional: mark test as functionality validation @@ -80,7 +80,7 @@ targets = . [flake8] ignore = E126,E226,E402,F401,W503,W504 max-line-length = 120 -exclude = +exclude = src, .git, __pycache__, @@ -112,14 +112,14 @@ add_select = D201,D213 branch = true source = ./ include = weaver/* -omit = +omit = setup.py docs/* tests/* *_mako [coverage:report] -exclude_lines = +exclude_lines = pragma: no cover raise AssertionError raise NotImplementedError