[pango/ebassi/for-master: 2/2] build: Remove deprecated python3 Meson module use




commit ddc282f6ca84dc6e6e5586a0addfa82a74e6e761
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Wed Sep 30 11:48:46 2020 +0100

    build: Remove deprecated python3 Meson module use
    
    We are using the deprecated python3 module for historical reasons. We
    used to support both Python 2 and Python 3 in the Autotools build, but
    since we switched to Meson we *know* we have Python 3 available. This
    allows us to use a shebang line in the Python scripts we use in the
    build, instead of invoking them through the Python interpreter in a
    custom target; Meson knows how to handle shebangs portably as well.
    
    This change removes the only deprecation warning coming from Meson when
    configuring the Pango build.

 tests/gen-all-unicode.py    | 2 ++
 tests/gen-installed-test.py | 2 ++
 tests/meson.build           | 5 ++---
 3 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/tests/gen-all-unicode.py b/tests/gen-all-unicode.py
index 011ab9d2..c30cfc49 100644
--- a/tests/gen-all-unicode.py
+++ b/tests/gen-all-unicode.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python3
+
 import sys
 
 # From glib/gutf8.c:
diff --git a/tests/gen-installed-test.py b/tests/gen-installed-test.py
index 794ea107..eeb4abee 100644
--- a/tests/gen-installed-test.py
+++ b/tests/gen-installed-test.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python3
+
 import sys
 import argparse
 import os
diff --git a/tests/meson.build b/tests/meson.build
index 6e10e2b7..b962a758 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -141,14 +141,13 @@ if get_option('install-tests')
   install_data(installed_test_items_data, install_dir: join_paths(installed_test_bindir, 'itemize'))
 endif
 
-python = import('python3').find_python()
 gen_installed_test = files([ 'gen-installed-test.py' ])
 gen_all_unicode = files([ 'gen-all-unicode.py' ])
 
 custom_target('all-unicode',
               output: 'all-unicode.txt',
               command: [
-                python, gen_all_unicode, '@OUTPUT@'
+                gen_all_unicode, '@OUTPUT@'
               ],
               install: get_option('install-tests'),
               install_dir: installed_test_bindir)
@@ -161,7 +160,7 @@ foreach t: tests
   custom_target(name + '.test',
                 output: name + '.test',
                 command: [
-                  python, gen_installed_test,
+                  gen_installed_test,
                   installed_test_bindir,
                   name,
                   '@OUTDIR@',


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