From 0e7fb07f915b7a2b04df209fbacd92aca19c87af Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Mon, 5 Sep 2022 21:12:56 -0400 Subject: python module: add an automatic byte-compilation step For all source `*.py` files installed via either py.install_sources() or an `install_dir: py.get_install_dir()`, produce `*.pyc` files at install time. Controllable via a module option. --- test cases/common/252 install data structured/meson.build | 2 +- test cases/python/2 extmodule/meson.build | 2 +- test cases/python/7 install path/meson.build | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'test cases') diff --git a/test cases/common/252 install data structured/meson.build b/test cases/common/252 install data structured/meson.build index 9d297943f..483474712 100644 --- a/test cases/common/252 install data structured/meson.build +++ b/test cases/common/252 install data structured/meson.build @@ -1,4 +1,4 @@ -project('install structured data') +project('install structured data', default_options: ['python.bytecompile=-1']) install_data( 'dir1/file1', diff --git a/test cases/python/2 extmodule/meson.build b/test cases/python/2 extmodule/meson.build index 8332afdd1..079463160 100644 --- a/test cases/python/2 extmodule/meson.build +++ b/test cases/python/2 extmodule/meson.build @@ -1,5 +1,5 @@ project('Python extension module', 'c', - default_options : ['buildtype=release', 'werror=true']) + default_options : ['buildtype=release', 'werror=true', 'python.bytecompile=-1']) # Because Windows Python ships only with optimized libs, # we must build this project the same way. diff --git a/test cases/python/7 install path/meson.build b/test cases/python/7 install path/meson.build index 22e33c653..2cac6523c 100644 --- a/test cases/python/7 install path/meson.build +++ b/test cases/python/7 install path/meson.build @@ -1,7 +1,8 @@ project('install path', default_options: [ + 'python.bytecompile=-1', 'python.purelibdir=/pure', - 'python.platlibdir=/plat' + 'python.platlibdir=/plat', ] ) -- cgit v1.2.3