]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
manager: meson: use existing script to check dependencies
authorAleš Mrázek <ales.mrazek@nic.cz>
Tue, 25 Oct 2022 22:45:12 +0000 (00:45 +0200)
committerAleš Mrázek <ales.mrazek@nic.cz>
Mon, 31 Oct 2022 10:32:25 +0000 (11:32 +0100)
tests/packaging/dependencies.py: argument for path to setup.py added

manager/meson.build
manager/tests/packaging/dependencies.py

index f17d93ba8ce2986bda503367a196af7ebc6e95b7..cfc8959269f0dbbf9da706f797f9c2ca5366e85a 100644 (file)
@@ -7,11 +7,14 @@ if get_option('manager') != 'disabled'
 
     pymod = import('python')
     py3 = pymod.find_installation('python3')
-    py3_deps = py3.dependency()
+    py3_deps = run_command(py3, 'tests/packaging/dependencies.py', 'setup.py', check: false)
 
     if py3.language_version().version_compare('<3.6')
         error('At least Python 3.6 is required.')
+    elif py3_deps.returncode() != 0
+        error(py3_deps.stderr().strip())
     else
+        message('all dependencies found')
         build_manager = true
     endif
 
index 6f3d4f404f68d0ae0446ff8ee95f31a8f06759c6..4a426b6e58b7b1df39e6f35a12d574713beb3eb2 100755 (executable)
@@ -15,7 +15,7 @@ sys.modules["setuptools"] = dummy
 sys.modules["build"] = dummy
 
 # load install_requires array from setup.py
-spec = importlib.util.spec_from_file_location("setup", "manager/setup.py")
+spec = importlib.util.spec_from_file_location("setup", sys.argv[1] if len(sys.argv) == 2 else "manager/setup.py")
 mod = importlib.util.module_from_spec(spec)
 spec.loader.exec_module(mod)
 install_requires = mod.install_requires