sp-hydra-veil/script_to_extract_dependencies.py

12 lines
243 B
Python

import tomllib
import json
with open('pyproject.toml', 'rb') as f:
data = tomllib.load(f)
deps = data.get('project', {}).get('dependencies', [])
with open('requirements.txt', 'w') as f:
for dep in deps:
f.write(dep + '\n')