conda2req/cvt_hardcoded.py

11 lines
341 B
Python

import yaml
import sys
with open(sys.argv[1]) as file_handle:
environment_data = yaml.load(file_handle)
with open("requirements.txt", "w") as file_handle:
for dependency in environment_data["dependencies"]:
if isinstance(dependency, dict):
for d in dependency["pip"]:
file_handle.write(f"{d}\n")