in03/proxima

IMPORTANT! Make this path resolution more robust

github-actions opened this issue · 1 comments

IMPORTANT! Make this path resolution more robust

URL/release install puts VC file in site-packages. The path is different

but just happens to be the same depth as the source structure.

Moving proxima into 'src' recently broke it. Also if pip setup changes, this will break.

# TODO: IMPORTANT! Make this path resolution more robust

def get_version_constraint_key() -> str:

    # TODO: IMPORTANT! Make this path resolution more robust
    # URL/release install puts VC file in site-packages. The path is different
    # but just happens to be the same depth as the source structure.
    # Moving proxima into 'src' recently broke it. Also if pip setup changes, this will break.

    vc_key_file = Path(__file__).parent.parent.parent.joinpath("version_constraint_key")
    logger.debug(f"[magenta]VC key file path: {vc_key_file}")
    with open(vc_key_file) as file:
        return file.read()

02fe2f354692e1512753eaeb529b6184b47e0180