tmbdev / tarproc

Assert statement used outside of tests BAN-B101
Security
Major
4 years ago4 years old
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
228        if "/__" in root:
229            continue
230        assert "__init__.py" in files, (root, dirs, files)
231    assert os.path.isdir("./docs")232    for fname in required_files:
233        assert os.path.exists(fname), fname
234    assert "run: make" not in open(".github/workflows/test.yml").read()
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
 37@task
 38def newversion(c):
 39    "Increment the version number."
 40    assert "working tree clean" in c.run("git status").stdout 41    text = open("setup.py").read()
 42    version = re.search('version *= *"([0-9.]+)"', text).group(1)
 43    print("old version", version)
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
 62@task
 63def release(c):
 64    "Tag the current version as a release on Github."
 65    assert "working tree clean" in c.run("git status").stdout 66    version = open("VERSION").read().strip()
 67    os.system(f"hub release create {version}")  # interactive
 68
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
227    for (root, dirs, files) in os.walk(f"./{PACKAGE}"):
228        if "/__" in root:
229            continue
230        assert "__init__.py" in files, (root, dirs, files)231    assert os.path.isdir("./docs")
232    for fname in required_files:
233        assert os.path.exists(fname), fname
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
230        assert "__init__.py" in files, (root, dirs, files)
231    assert os.path.isdir("./docs")
232    for fname in required_files:
233        assert os.path.exists(fname), fname234    assert "run: make" not in open(".github/workflows/test.yml").read()
235