24_deb_pkg_gov/main.py
2023-10-23 15:40:24 -05:00

34 lines
1.2 KiB
Python

import perceval
import os
import yaml
import perceval_tasks as pt
import github_api_req as gha
import datetime as dt
#TODO: get lists of authors -> get lists of contributors -> compute 'Mean Membership Type'
#TODO: compute Formality level metric
def main():
# we should discuss whether we're using the 93 day window that seems to be widely used or if we want a longer window
early_cutoff = dt.datetime(2015,3, 17)
print("earliest date examined: " + str(early_cutoff))
#placeholder for now
manifest = '../kaylea_dissertation/lifecycle/package_metadata/jupyter-notebook_manifest.yaml'
with open(manifest, 'r') as stream:
try:
config = yaml.safe_load(stream)
#below lines will probably need to be refactored as tasks expand
vcs_path = config['Upstream_VCS']
perceval_obj = pt.main(vcs_path, early_cutoff)
gha_obj = gha.main(vcs_path, early_cutoff)
#these are the two variables in the denominator of the formality measure
print(perceval_obj['age_of_project'])
print(gha_obj['milestone_count'])
except yaml.YAMLOError as err:
print(err)
if __name__ == "__main__":
main()