Blob Blame History Raw
From 64e1f75b65f8710a1f293c473470ab0991107c69 Mon Sep 17 00:00:00 2001
From: shubham1206agra <tt1191044@iitd.ac.in>
Date: Wed, 27 Apr 2022 19:11:02 +0530
Subject: [PATCH 1/6] trying config file

---
 src/mlpack/bindings/python/setup.cfg | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/mlpack/bindings/python/setup.cfg b/src/mlpack/bindings/python/setup.cfg
index b7e478982cc..cd73819e204 100644
--- a/src/mlpack/bindings/python/setup.cfg
+++ b/src/mlpack/bindings/python/setup.cfg
@@ -1,2 +1,4 @@
 [aliases]
 test=pytest
+[install]
+install-platlib=libxxx

From fef34ea8db04060479255608d2e226468d8b5b13 Mon Sep 17 00:00:00 2001
From: shubham1206agra <tt1191044@iitd.ac.in>
Date: Wed, 27 Apr 2022 19:25:31 +0530
Subject: [PATCH 2/6] trying something else

---
 src/mlpack/bindings/python/copy_artifacts.py | 2 ++
 src/mlpack/bindings/python/setup.cfg         | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mlpack/bindings/python/copy_artifacts.py b/src/mlpack/bindings/python/copy_artifacts.py
index ab62a403c55..12fe34c1e7f 100644
--- a/src/mlpack/bindings/python/copy_artifacts.py
+++ b/src/mlpack/bindings/python/copy_artifacts.py
@@ -11,6 +11,8 @@
 import shutil
 import os
 
+print(sysconfig.get_config_var('ext_suffix'))
+
 directory = 'build/lib.' + \
             sysconfig.get_platform() + \
             '-' + \
diff --git a/src/mlpack/bindings/python/setup.cfg b/src/mlpack/bindings/python/setup.cfg
index cd73819e204..b7e478982cc 100644
--- a/src/mlpack/bindings/python/setup.cfg
+++ b/src/mlpack/bindings/python/setup.cfg
@@ -1,4 +1,2 @@
 [aliases]
 test=pytest
-[install]
-install-platlib=libxxx

From 577cc2d6929d6b22d671f314a49756815d99b4c1 Mon Sep 17 00:00:00 2001
From: shubham1206agra <tt1191044@iitd.ac.in>
Date: Thu, 28 Apr 2022 10:33:02 +0530
Subject: [PATCH 3/6] new directory structure using glob

---
 src/mlpack/bindings/python/copy_artifacts.py | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/src/mlpack/bindings/python/copy_artifacts.py b/src/mlpack/bindings/python/copy_artifacts.py
index 12fe34c1e7f..f5bc15b802e 100644
--- a/src/mlpack/bindings/python/copy_artifacts.py
+++ b/src/mlpack/bindings/python/copy_artifacts.py
@@ -10,16 +10,19 @@
 import sysconfig
 import shutil
 import os
+import glob
 
-print(sysconfig.get_config_var('ext_suffix'))
+# directory = 'build/lib.' + \
+#             sysconfig.get_platform() + \
+#             '-' + \
+#             str(sys.version_info[0]) + \
+#             '.' + \
+#             str(sys.version_info[1]) + \
+#             '/mlpack/'
 
-directory = 'build/lib.' + \
-            sysconfig.get_platform() + \
-            '-' + \
-            str(sys.version_info[0]) + \
-            '.' + \
-            str(sys.version_info[1]) + \
-            '/mlpack/'
+# New directory structure
+directory = glob.glob('build/lib.' + sysconfig.get_platform() + '*/mlpack')[0]
+directory = directory.replace('\\', '/')
 
 # Now copy all the files from the directory to the desired location.
 for f in os.listdir(directory):

From feab906927dca5a88a19ec00dea281263e4be35d Mon Sep 17 00:00:00 2001
From: shubham1206agra <tt1191044@iitd.ac.in>
Date: Thu, 28 Apr 2022 11:28:32 +0530
Subject: [PATCH 4/6] missing '/' added

---
 src/mlpack/bindings/python/copy_artifacts.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mlpack/bindings/python/copy_artifacts.py b/src/mlpack/bindings/python/copy_artifacts.py
index f5bc15b802e..672260acf6e 100644
--- a/src/mlpack/bindings/python/copy_artifacts.py
+++ b/src/mlpack/bindings/python/copy_artifacts.py
@@ -21,7 +21,7 @@
 #             '/mlpack/'
 
 # New directory structure
-directory = glob.glob('build/lib.' + sysconfig.get_platform() + '*/mlpack')[0]
+directory = glob.glob('build/lib.' + sysconfig.get_platform() + '*/mlpack/')[0]
 directory = directory.replace('\\', '/')
 
 # Now copy all the files from the directory to the desired location.

From 3cfbb4e65d9822df8a25c5625d189ac734665c7b Mon Sep 17 00:00:00 2001
From: shubham1206agra <tt1191044@iitd.ac.in>
Date: Thu, 28 Apr 2022 12:36:51 +0530
Subject: [PATCH 5/6] cleanup

---
 src/mlpack/bindings/python/copy_artifacts.py | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/src/mlpack/bindings/python/copy_artifacts.py b/src/mlpack/bindings/python/copy_artifacts.py
index 672260acf6e..ed28718302b 100644
--- a/src/mlpack/bindings/python/copy_artifacts.py
+++ b/src/mlpack/bindings/python/copy_artifacts.py
@@ -6,20 +6,11 @@
 # terms of the 3-clause BSD license.  You should have received a copy of the
 # 3-clause BSD license along with mlpack.  If not, see
 # http://www.opensource.org/licenses/BSD-3-Clause for more information.
-import sys
 import sysconfig
 import shutil
 import os
 import glob
 
-# directory = 'build/lib.' + \
-#             sysconfig.get_platform() + \
-#             '-' + \
-#             str(sys.version_info[0]) + \
-#             '.' + \
-#             str(sys.version_info[1]) + \
-#             '/mlpack/'
-
 # New directory structure
 directory = glob.glob('build/lib.' + sysconfig.get_platform() + '*/mlpack/')[0]
 directory = directory.replace('\\', '/')

From 54e2914430ed4862ecdbde557790e828d9e6a7af Mon Sep 17 00:00:00 2001
From: Shubham Agrawal <58412969+shubham1206agra@users.noreply.github.com>
Date: Fri, 29 Apr 2022 10:20:14 +0530
Subject: [PATCH 6/6] Update src/mlpack/bindings/python/copy_artifacts.py

Co-authored-by: Ryan Curtin <ryan@ratml.org>
---
 src/mlpack/bindings/python/copy_artifacts.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mlpack/bindings/python/copy_artifacts.py b/src/mlpack/bindings/python/copy_artifacts.py
index ed28718302b..969be65451a 100644
--- a/src/mlpack/bindings/python/copy_artifacts.py
+++ b/src/mlpack/bindings/python/copy_artifacts.py
@@ -11,7 +11,7 @@
 import os
 import glob
 
-# New directory structure
+# Match any lib.$platform*/mlpack/ directory.
 directory = glob.glob('build/lib.' + sysconfig.get_platform() + '*/mlpack/')[0]
 directory = directory.replace('\\', '/')