Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Python] Fix setup.py for inplace build #16214

Merged
merged 1 commit into from
Dec 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
CURRENT_DIR = os.path.dirname(__file__)
FFI_MODE = os.environ.get("TVM_FFI", "auto")
CONDA_BUILD = os.getenv("CONDA_BUILD") is not None
INPLACE_BUILD = "--inplace" in sys.argv


def get_lib_path():
Expand All @@ -46,7 +47,7 @@ def get_lib_path():
libinfo = {"__file__": libinfo_py}
exec(compile(open(libinfo_py, "rb").read(), libinfo_py, "exec"), libinfo, libinfo)
version = libinfo["__version__"]
if not CONDA_BUILD:
if not CONDA_BUILD and not INPLACE_BUILD:
lib_path = libinfo["find_lib_path"]()
libs = [lib_path[0]]
if "runtime" not in libs[0]:
Expand Down Expand Up @@ -214,7 +215,7 @@ def is_pure(self):


setup_kwargs = {}
if not CONDA_BUILD:
if not CONDA_BUILD and not INPLACE_BUILD:
with open("MANIFEST.in", "w") as fo:
for path in LIB_LIST:
if os.path.isfile(path):
Expand Down Expand Up @@ -286,7 +287,7 @@ def long_description_contents():
)


if not CONDA_BUILD:
if not CONDA_BUILD and not INPLACE_BUILD:
# Wheel cleanup
os.remove("MANIFEST.in")
for path in LIB_LIST:
Expand Down