diff options
-rw-r--r-- | azure-pipelines.yml | 9 | ||||
-rw-r--r-- | mesonbuild/modules/python.py | 5 | ||||
-rwxr-xr-x | run_unittests.py | 9 |
3 files changed, 16 insertions, 7 deletions
diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 55b6972..497c09b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -122,20 +122,21 @@ jobs: librhash0,^ libuv1,^ ninja,^ - python35-pip,^ + python2-devel,^ + python3-devel,^ + python36-pip,^ vala,^ wget,^ cmake,^ zlib-devel displayName: Install Dependencies - script: | - %CYGWIN_ROOT%\bin\python3.5m.exe -m pip --disable-pip-version-check install pytest-xdist + set PATH=%CYGWIN_ROOT%\bin;%SYSTEMROOT%\system32 + env.exe -- python3 -m pip --disable-pip-version-check install pytest-xdist displayName: pip install pytest-xdist - script: | set BOOST_ROOT= set PATH=%CYGWIN_ROOT%\bin;%SYSTEMROOT%\system32 - # FIXME: we need to support systems without unversioned `python3` - cp /usr/bin/python3.5 /usr/bin/python3 env.exe -- python3 run_tests.py --backend=ninja displayName: Run Tests - task: CopyFiles@2 diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py index fc9ec9b..7832eb8 100644 --- a/mesonbuild/modules/python.py +++ b/mesonbuild/modules/python.py @@ -115,7 +115,6 @@ class PythonDependency(ExternalDependency): self._find_libpy_windows(environment) else: self._find_libpy(python_holder, environment) - if self.is_found: mlog.debug('Found "python-{}" via SYSCONFIG module'.format(self.version)) py_lookup_method = 'sysconfig' @@ -123,7 +122,7 @@ class PythonDependency(ExternalDependency): if self.is_found: mlog.log('Dependency', mlog.bold(self.name), 'found:', mlog.green('YES ({})'.format(py_lookup_method))) else: - mlog.log('Dependency', mlog.bold(self.name), 'found:', [mlog.red('NO')]) + mlog.log('Dependency', mlog.bold(self.name), 'found:', mlog.red('NO')) def _find_libpy(self, python_holder, environment): if python_holder.is_pypy: @@ -145,7 +144,7 @@ class PythonDependency(ExternalDependency): if largs is not None: self.link_args = largs - self.is_found = largs is not None or not self.link_libpython + self.is_found = largs is not None or self.link_libpython inc_paths = mesonlib.OrderedSet([ self.variables.get('INCLUDEPY'), diff --git a/run_unittests.py b/run_unittests.py index 2df8bcb..d6c81a1 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -6341,6 +6341,15 @@ class NativeFileTests(BasePlatformTests): # python module breaks. This is fine on other OSes because they # don't need the extra indirection. raise unittest.SkipTest('bat indirection breaks internal sanity checks.') + if os.path.exists('/etc/debian_version'): + rc = subprocess.call(['pkg-config', '--cflags', 'python2'], + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL) + if rc != 0: + # Python 2 will be removed in Debian Bullseye, thus we must + # remove the build dependency on python2-dev. Keep the tests + # but only run them if dev packages are available. + raise unittest.SkipTest('Not running Python 2 tests because dev packages not installed.') self._simple_test('python', 'python') @unittest.skipIf(is_windows(), 'Setting up multiple compilers on windows is hard') |