forked from iree-org/iree-jax
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
55 lines (47 loc) · 1.29 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Copyright 2021 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
import json
import os
from setuptools import find_namespace_packages, setup
# Setup and get version information.
THIS_DIR = os.path.realpath(os.path.dirname(__file__))
IREESRC_DIR = os.path.join(THIS_DIR, "..", "..")
VERSION_INFO_FILE = os.path.join(IREESRC_DIR, "version_info.json")
def load_version_info():
with open(VERSION_INFO_FILE, "rt") as f:
return json.load(f)
try:
version_info = load_version_info()
except FileNotFoundError:
print("version_info.json not found. Using defaults")
version_info = {}
PACKAGE_SUFFIX = version_info.get("package-suffix") or "-dev"
PACKAGE_VERSION = version_info.get("package-version") or "0.1dev1"
setup(
name=f"iree-jax{PACKAGE_SUFFIX}",
version=f"{PACKAGE_VERSION}",
packages=find_namespace_packages(include=[
"iree.jax",
"iree.jax.*",
],),
install_requires=[
"numpy",
"jax",
"iree-compiler",
"iree-runtime",
],
extras_require={
"xla": [
"iree-tools-xla",
],
"cpu": [
"jax[cpu]",
],
"test": [
"lit",
]
},
)