From c6c7321e35aae8e3385d8232b51074e58becd053 Mon Sep 17 00:00:00 2001 From: Marius Brehler Date: Wed, 30 Oct 2024 13:57:17 +0100 Subject: [PATCH] [sharktank] Revise `setup.py` file (#346) * Move `version_info.json` to sharktank subdir * Pulls in the local requirements file for sharktank --- sharktank/setup.py | 12 +++++++----- version_info.json => sharktank/version_info.json | 0 2 files changed, 7 insertions(+), 5 deletions(-) rename version_info.json => sharktank/version_info.json (100%) 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