leandron commented on code in PR #12000:
URL: https://github.com/apache/tvm/pull/12000#discussion_r913150062


##########
python/setup.py:
##########
@@ -194,7 +194,15 @@ def is_pure(self):
     curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
     for i, path in enumerate(LIB_LIST):
         LIB_LIST[i] = os.path.relpath(path, curr_path)
-    setup_kwargs = {"include_package_data": True, "data_files": [("tvm", 
LIB_LIST)]}
+    LIB_DATA_FILES = []
+    if os.path.isfile(path):

Review Comment:
   The variable `path` in `if os.path.isfile(path):` is produced by the 
`enumerate(LIB_LIST)` above, right? So it seems the indentation of this block 
doesn't match with the variable of the iteration, and it is only catching the 
last value on the list? Can you double check on whether this is the expected 
behaviour?



##########
python/setup.py:
##########
@@ -194,7 +194,15 @@ def is_pure(self):
     curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
     for i, path in enumerate(LIB_LIST):
         LIB_LIST[i] = os.path.relpath(path, curr_path)
-    setup_kwargs = {"include_package_data": True, "data_files": [("tvm", 
LIB_LIST)]}
+    LIB_DATA_FILES = []
+    if os.path.isfile(path):
+        LIB_DATA_FILES.append(os.path.relpath(path, curr_path))
+    if os.path.isdir(path):
+        for root, dirs, files in os.walk(path):
+            for filename in files:
+                file_path = os.path.join(root, filename)
+                LIB_DATA_FILES.append(os.path.relpath(file_path, curr_path))
+    setup_kwargs = {"include_package_data": True, "data_files": [("tvm", 
LIB_DATA_FILES)]}

Review Comment:
   The logic here seems duplicated with `f"recursive-include tvm/{libname} 
*\n"` above. Is there a way to unify so that we can only add files in one 
standard way that works for local installation as well as packaging?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to