-
Notifications
You must be signed in to change notification settings - Fork 329
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated make setup and added comparing tools
- Loading branch information
1 parent
25f10a2
commit 4c591d9
Showing
3 changed files
with
73 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import requests | ||
import json | ||
|
||
|
||
def compare_json(tool_versions_json_path): | ||
# Get the upstream JSON from the URL | ||
upstream_url = 'https://raw.githubusercontent.com/efabless/central_CI/main/tools.json' | ||
response = requests.get(upstream_url) | ||
if response.status_code != 200: | ||
raise ValueError(f'Failed to get upstream JSON from {upstream_url}: {response.status_code}') | ||
upstream_json = response.json() | ||
|
||
# Load the tool_versions.json | ||
with open(tool_versions_json_path, 'r') as tool_versions_file: | ||
tool_versions_json = json.load(tool_versions_file) | ||
|
||
# Compare the two JSON objects | ||
if upstream_json == tool_versions_json: | ||
print("The upstream JSON is the same as tool_versions.json") | ||
else: | ||
print("The upstream JSON is different from tool_versions.json, please update by running make setup") | ||
exit(1) | ||
|
||
|
||
compare_json("./tool_versions.json") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters