Skip to content

Commit

Permalink
Update update_requirements script
Browse files Browse the repository at this point in the history
  • Loading branch information
Limych committed Jul 10, 2022
1 parent 6367c69 commit d91b5eb
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions bin/update_requirements
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def get_package(requre: str) -> str:
return requre.split(">")[0].split("<")[0].split("!")[0].split("=")[0].split("~")[0]


harequire = []
harequire = ["homeassistant"]
request = requests.get(
"https://raw.githubusercontent.com/home-assistant/core/dev/requirements.txt"
)
Expand All @@ -41,13 +41,10 @@ with open(f"{ROOT}/requirements.txt", encoding="utf8") as requirements:
tmp = requirements.readlines()
requirements = []
for req in tmp:
requirements.append(req.replace("\n", ""))
pkg = get_package(req)
if pkg not in harequire:
requirements.append(req.replace("\n", ""))
manifest["requirements"] = requirements

for req in manifest["requirements"]:
pkg = get_package(req)
if pkg in harequire:
print(f"{pkg} in HA requirements, no need here.")

with open(f"{PKG_PATH}/manifest.json", "w", encoding="utf8") as manifestfile:
manifestfile.write(json.dumps(manifest, indent=4))

0 comments on commit d91b5eb

Please sign in to comment.