diff --git a/sharktank/setup.py b/sharktank/setup.py index 8ffcf3984..f0b19f7ba 100644 --- a/sharktank/setup.py +++ b/sharktank/setup.py @@ -11,14 +11,12 @@ from setuptools import find_namespace_packages, setup # type: ignore -THIS_DIR = Path(__file__).resolve().parent -REPO_DIR = THIS_DIR.parent -VERSION_INFO_FILE = REPO_DIR / "version_info.json" +SETUPPY_DIR = os.path.realpath(os.path.dirname(__file__)) with open( os.path.join( - THIS_DIR, + SETUPPY_DIR, "README.md", ), "rt", @@ -26,6 +24,10 @@ README = f.read() +# Setup and get version information. +VERSION_INFO_FILE = os.path.join(SETUPPY_DIR, "version_info.json") + + def load_version_info(): with open(VERSION_INFO_FILE, "rt") as f: return json.load(f) @@ -54,7 +56,7 @@ def load_requirement_pins(requirements_file: Path): requirement_pins.update(dict(pin_pairs)) -load_requirement_pins(REPO_DIR / "requirements.txt") +load_requirement_pins("requirements.txt") def get_version_spec(dep: str): diff --git a/version_info.json b/sharktank/version_info.json similarity index 100% rename from version_info.json rename to sharktank/version_info.json