Download scripts/check_environment.py from nmarshall/nanobrush: direct link, hf CLI and curl.
- Browser
- Download file 745 Bytes
-
https://huggingface.co/nmarshall/nanobrush/resolve/main/scripts/check_environment.py
- Command line
-
hf download hf://nmarshall/nanobrush/scripts/check_environment.py
-
curl -L -o check_environment.py https://huggingface.co/nmarshall/nanobrush/resolve/main/scripts/check_environment.py
745 Bytes
| #!/usr/bin/env python3 | |
| """Report the tooling required by the preservation/setup stage.""" | |
| import shutil | |
| import subprocess | |
| import sys | |
| def main(): | |
| missing = [] | |
| for tool in ("git", "git-lfs", "git-xet", "python3", "nix", "direnv", "rustc", "cargo"): | |
| path = shutil.which(tool) | |
| if not path: | |
| missing.append(tool) | |
| print(f"{tool}: missing") | |
| continue | |
| result = subprocess.run([path, "--version"], capture_output=True, text=True) | |
| lines = (result.stdout or result.stderr).splitlines() | |
| print(f"{tool}: {lines[0] if lines else path}") | |
| if result.returncode: | |
| missing.append(tool) | |
| return bool(missing) | |
| if __name__ == "__main__": | |
| sys.exit(main()) | |