diff --git a/.gitignore b/.gitignore index c3473e1c91..5cc5fb6a76 100644 --- a/.gitignore +++ b/.gitignore @@ -124,3 +124,6 @@ node_modules/ /build-vision-spark/ /terminal/.venv-build/ /.venv-build/ + +# scratch folder of local audit scripts (never committed) +_tmp_audit/ diff --git a/_tmp_audit/hy4_audit.py b/_tmp_audit/hy4_audit.py deleted file mode 100644 index c25514db1c..0000000000 --- a/_tmp_audit/hy4_audit.py +++ /dev/null @@ -1,34 +0,0 @@ -"""Read-only: stream each hy4 package of the v0.2.21 release (nothing is saved) and run tools/packaging/lib_notices rules over its member list. - python _tmp_audit/hy4_audit.py _tmp_audit/hy4_urls.txt""" -import sys -import tarfile -import urllib.request -from pathlib import Path - -sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "tools" / "packaging")) -import lib_notices # noqa: E402 - -for url in Path(sys.argv[1]).read_text().split(): - name = url.rsplit("/", 1)[-1] - try: - req = urllib.request.Request(url, headers={"User-Agent": "audit"}) - with urllib.request.urlopen(req, timeout=300) as resp: - names = [] - with tarfile.open(fileobj=resp, mode="r|gz") as t: - for m in t: - if m.isfile(): - names.append(m.name) - except Exception as exc: # noqa: BLE001 - print(f"{name}: ERROR {exc}") - continue - names = [n[2:] if n.startswith("./") else n for n in names] - lic = sorted(n for n in names if "licenses/" in "/" + n.lower()) - libs = [n for n in names if lib_notices.is_library(n)] - bad = [] - for n in libs: - rule = lib_notices.rule_for(n) - if rule is None: - bad.append(f"{Path(n).name} (no rule)") - elif rule and not any(any(Path(l).name == r for l in lic) for r in rule): - bad.append(f"{Path(n).name} (needs {rule[0]})") - print(f"{name}: {len(names)} files, {len(libs)} libraries, licence files {len(lic)} {[Path(l).name for l in lic][:6]}; libraries without their notice: {len(bad)} {bad[:6]}", flush=True) diff --git a/_tmp_audit/hy4_urls.txt b/_tmp_audit/hy4_urls.txt deleted file mode 100644 index 651bc5c701..0000000000 --- a/_tmp_audit/hy4_urls.txt +++ /dev/null @@ -1,15 +0,0 @@ -https://github.com/Niko1221/Strata/releases/download/v0.2.21/strata-hy4-0.1.67-linux-aarch64-cuda-cuda13.tar.gz -https://github.com/Niko1221/Strata/releases/download/v0.2.21/strata-hy4-0.1.67-linux-x86_64-cuda-cuda12.tar.gz -https://github.com/Niko1221/Strata/releases/download/v0.2.21/strata-hy4-0.1.67-linux-x86_64-cuda-cuda13.tar.gz -https://github.com/Niko1221/Strata/releases/download/v0.2.21/strata-hy4-0.1.67-linux-x86_64-hip-halo.tar.gz -https://github.com/Niko1221/Strata/releases/download/v0.2.21/strata-hy4-0.1.67-linux-x86_64-hip-rx6000.tar.gz -https://github.com/Niko1221/Strata/releases/download/v0.2.21/strata-hy4-0.1.67-linux-x86_64-hip-rx7900.tar.gz -https://github.com/Niko1221/Strata/releases/download/v0.2.21/strata-hy4-0.1.67-linux-x86_64-hip-rx9070.tar.gz -https://github.com/Niko1221/Strata/releases/download/v0.2.21/strata-hy4-0.1.67-linux-x86_64-sycl.tar.gz -https://github.com/Niko1221/Strata/releases/download/v0.2.21/strata-hy4-0.1.67-macos-arm64-metal.tar.gz -https://github.com/Niko1221/Strata/releases/download/v0.2.21/strata-hy4-0.1.67-windows-x86_64-cuda-cuda12.tar.gz -https://github.com/Niko1221/Strata/releases/download/v0.2.21/strata-hy4-0.1.67-windows-x86_64-cuda-cuda13.tar.gz -https://github.com/Niko1221/Strata/releases/download/v0.2.21/strata-hy4-0.1.67-windows-x86_64-hip-rdna2.tar.gz -https://github.com/Niko1221/Strata/releases/download/v0.2.21/strata-hy4-0.1.67-windows-x86_64-hip-rdna3.tar.gz -https://github.com/Niko1221/Strata/releases/download/v0.2.21/strata-hy4-0.1.67-windows-x86_64-hip-rx9070.tar.gz -https://github.com/Niko1221/Strata/releases/download/v0.2.21/strata-hy4-0.1.67-windows-x86_64-hip-strix.tar.gz