aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mesonmain.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2022-12-25 02:19:14 -0500
committerEli Schwartz <eschwartz@archlinux.org>2023-01-04 16:46:49 -0500
commit9aff189e315ccbe3444c75aef412d311fa95fcd2 (patch)
treefeab46d850cc95148cf81303b27908db1ec5c8bf /mesonbuild/mesonmain.py
parentd573db77bc7883b32de97b476e0d880d810bb45c (diff)
downloadmeson-9aff189e315ccbe3444c75aef412d311fa95fcd2.zip
meson-9aff189e315ccbe3444c75aef412d311fa95fcd2.tar.gz
meson-9aff189e315ccbe3444c75aef412d311fa95fcd2.tar.bz2
add a hidden environment variable to make Meson complain hard on deprecations
Useful for running the testsuite with this environment variable and catching obscure issues. Just like with the encoding warning later down, we have to do this inside meson itself, not externally injected.
Diffstat (limited to 'mesonbuild/mesonmain.py')
-rw-r--r--mesonbuild/mesonmain.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py
index ca38f29..369b411 100644
--- a/mesonbuild/mesonmain.py
+++ b/mesonbuild/mesonmain.py
@@ -235,6 +235,13 @@ def set_meson_command(mainfile):
mesonlib.set_meson_command(mainfile)
def run(original_args, mainfile):
+ if os.environ.get('MESON_SHOW_DEPRECATIONS'):
+ # workaround for https://bugs.python.org/issue34624
+ import warnings
+ for typ in [DeprecationWarning, SyntaxWarning, FutureWarning, PendingDeprecationWarning]:
+ warnings.filterwarnings('error', category=typ, module='mesonbuild')
+ warnings.filterwarnings('ignore', message=".*importlib-resources.*")
+
if sys.version_info >= (3, 10) and os.environ.get('MESON_RUNNING_IN_PROJECT_TESTS'):
# workaround for https://bugs.python.org/issue34624
import warnings