[jhbuild/wip/hadess/auto-distutils: 2/2] make: Add distutils detection for unknown modules




commit 628b234c60870eb934cd4d8c4731e7b3c394a928
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Nov 4 14:59:43 2021 +0100

    make: Add distutils detection for unknown modules
    
    As a follow-up to 1aa92aed2e7431b247e09fe63e43fa85931f26c5, assume that
    unknown modules with a "setup.py" file are Python3 distutils modules.

 jhbuild/commands/make.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/jhbuild/commands/make.py b/jhbuild/commands/make.py
index 29e823ac..d44fa5be 100644
--- a/jhbuild/commands/make.py
+++ b/jhbuild/commands/make.py
@@ -88,8 +88,12 @@ class cmd_make(Command):
                 logging.error(_('No module matching current directory %r in the moduleset') % (modname, ))
                 return False
 
-            # Try meson first, then autotools
-            if os.path.exists(os.path.join(self.get_cwd(), 'meson.build')):
+            # Try distutils, then meson, then autotools
+            if os.path.exists(os.path.join(self.get_cwd(), 'setup.py')):
+                from jhbuild.modtypes.distutils import DistutilsModule
+                module = DistutilsModule(modname, default_repo.branch(modname))
+                module.python = os.environ.get('PYTHON3', 'python3')
+            elif os.path.exists(os.path.join(self.get_cwd(), 'meson.build')):
                 from jhbuild.modtypes.meson import MesonModule
                 module = MesonModule(modname, default_repo.branch(modname))
             else:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]