nfl-playoff-challenge-streamlit / update_streamlit_version.py
Jon Solow
Add everything from yfdashboard
dd64f21
raw
history blame contribute delete
541 Bytes
import pathlib
import pkg_resources
import re
package_name = "streamlit"
with pathlib.Path("requirements.txt").open() as requirements_txt:
for requirement in pkg_resources.parse_requirements(requirements_txt):
if requirement.name == package_name:
version = requirement.specs[0][-1]
break
print(version)
with open("README.md", "r") as f:
contents = f.read()
replaced = re.sub(r"sdk_version:.*", f"sdk_version: {version}", contents, 1)
with open("README.md", "w") as f:
f.write(replaced)