docs: fix links for package publishing

This commit is contained in:
Bryce 2023-02-23 01:28:56 -08:00 committed by Bryce Drennan
parent 9831d8a24a
commit c0c8e081b8

View File

@ -1,4 +1,6 @@
import subprocess
import sys
from functools import lru_cache
from setuptools import find_packages, setup
@ -17,8 +19,19 @@ else:
entry_points = None
@lru_cache()
def get_git_revision_hash() -> str:
return subprocess.check_output(["git", "rev-parse", "HEAD"]).decode("ascii").strip()
revision_hash = get_git_revision_hash()
with open("README.md", encoding="utf-8") as f:
readme = f.read()
readme = readme.replace(
'<img src="',
f'<img src="https://raw.githubusercontent.com/brycedrennan/imaginAIry/{revision_hash}/',
)
setup(
name="imaginAIry",