24_deb_pkg_gov/perceval_tasks.py

26 lines
793 B
Python
Raw Normal View History

2023-10-19 16:46:00 +00:00
import perceval
import venv
import yaml
import subprocess
def main(manifest):
with open(manifest, 'r') as stream:
#try:
config = yaml.safe_load(stream)
get_perceval_log(config['Upstream_VCS'])
print(config['Upstream_VCS'])
#except yaml.YAMLOError as err:
# print(err)
def get_perceval_log(vcs_path):
print(vcs_path)
perceval_output = subprocess.run(['perceval', 'git', vcs_path[0], '--from-date', '2023-08-08'], capture_output=True)
print(type(perceval_output.__str__()))
with open('test_perceval_output.txt', 'w') as f:
f.write(perceval_output.__str__())
print('COMPLETE')
if __name__ == "__main__":
manifest = '../kaylea_dissertation/lifecycle/package_metadata/woof_manifest.yaml'
main(manifest)