From e7b8488be8cdc26c6c6da575e5a85213b9f5f267 Mon Sep 17 00:00:00 2001 From: leahwicz <60146280+leahwicz@users.noreply.github.com> Date: Thu, 5 Aug 2021 15:27:56 -0400 Subject: [PATCH] Remove converter.py since not used anymore (#3699) --- converter.py | 73 ---------------------------------------------------- 1 file changed, 73 deletions(-) delete mode 100755 converter.py diff --git a/converter.py b/converter.py deleted file mode 100755 index e9a6cb22141..00000000000 --- a/converter.py +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env python -import json -import yaml -import sys -import argparse -from datetime import datetime, timezone -import dbt.clients.registry as registry - - -def yaml_type(fname): - with open(fname) as f: - return yaml.load(f) - - -def parse_args(): - parser = argparse.ArgumentParser() - parser.add_argument("--project", type=yaml_type, default="dbt_project.yml") - parser.add_argument("--namespace", required=True) - return parser.parse_args() - - -def get_full_name(args): - return "{}/{}".format(args.namespace, args.project["name"]) - - -def init_project_in_packages(args, packages): - full_name = get_full_name(args) - if full_name not in packages: - packages[full_name] = { - "name": args.project["name"], - "namespace": args.namespace, - "latest": args.project["version"], - "assets": {}, - "versions": {}, - } - return packages[full_name] - - -def add_version_to_package(args, project_json): - project_json["versions"][args.project["version"]] = { - "id": "{}/{}".format(get_full_name(args), args.project["version"]), - "name": args.project["name"], - "version": args.project["version"], - "description": "", - "published_at": datetime.now(timezone.utc).astimezone().isoformat(), - "packages": args.project.get("packages") or [], - "works_with": [], - "_source": { - "type": "github", - "url": "", - "readme": "", - }, - "downloads": { - "tarball": "", - "format": "tgz", - "sha1": "", - }, - } - - -def main(): - args = parse_args() - packages = registry.packages() - project_json = init_project_in_packages(args, packages) - if args.project["version"] in project_json["versions"]: - raise Exception("Version {} already in packages JSON" - .format(args.project["version"]), - file=sys.stderr) - add_version_to_package(args, project_json) - print(json.dumps(packages, indent=2)) - -if __name__ == "__main__": - main()