Skip to content

Commit

Permalink
add latest version check
Browse files Browse the repository at this point in the history
  • Loading branch information
amdomanska committed Nov 2, 2022
1 parent 8960e60 commit 5fa3dc9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
15 changes: 11 additions & 4 deletions dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,23 @@
if __name__ == "__main__":
rc = subprocess.call("./dependencies.sh")

with open("dependencies.json", encoding='utf-8') as file:
with open("dependencies_analysis/dependencies.json", encoding='utf-8') as file:
lst = json.load(file)

with open("dependencies_analysis/upgrade.json", encoding='utf-8') as file:
upg = json.load(file)

out = []
for d in lst:
out.append({})
for k, v in d["package"].items():
out[-1][f"package.{k}"] = v
out[-1]["dependencies"] = "; ".join(v["key"] for v in d["dependencies"])

df = pd.DataFrame(out)
print(df)
df.to_csv("dependencies.csv", index=False)
df_dep = pd.DataFrame(out)
df_upgrade = pd.DataFrame(upg)

all = df_dep.merge(right=df_upgrade, how="left", left_on="package.package_name", right_on="name")
all_short = all.drop(columns=["name","version", "latest_filetype", "editable_project_location"])
all_short = all_short[["package.key","package.package_name","package.installed_version","latest_version","dependencies"]]
all_short.to_csv("dependencies_analysis/dependencies.csv", index=False)
7 changes: 4 additions & 3 deletions dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/sh

rm dependencies.json
rm dependencies.csv
rm -rf dependencies_analysis
mkdir dependencies_analysis

pipdeptree --json --reverse >> dependencies.json
pipdeptree --json -l >> dependencies_analysis/dependencies.json
pip list --format json -o >> dependencies_analysis/upgrade.json

0 comments on commit 5fa3dc9

Please sign in to comment.