From 309b6373180a2320a23eecfdb8609c7746eda8a9 Mon Sep 17 00:00:00 2001 From: Praneeth Kodumagulla <64239307+praneethhere@users.noreply.github.com> Date: Thu, 7 May 2026 07:36:08 -0500 Subject: [PATCH] BUG: exclude __pycache__ directories from wheels (#31397) --- numpy/meson.build | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/numpy/meson.build b/numpy/meson.build index 45d5a2b52eb8..36694ef4efd8 100644 --- a/numpy/meson.build +++ b/numpy/meson.build @@ -363,13 +363,28 @@ else endif foreach subdir: pure_subdirs - install_subdir(subdir, install_dir: np_dir, install_tag: 'python-runtime', exclude_directories: ['tests']) + install_subdir( + subdir, + install_dir: np_dir, + install_tag: 'python-runtime', + exclude_directories: ['tests', '__pycache__'] + ) if fs.is_dir(subdir/'tests') - install_subdir(subdir/'tests', install_dir: np_dir/subdir, install_tag: 'tests') + install_subdir( + subdir/'tests', + install_dir: np_dir/subdir, + install_tag: 'tests', + exclude_directories: ['__pycache__'] + ) endif endforeach -install_subdir('tests', install_dir: np_dir, install_tag: 'tests') +install_subdir( + 'tests', + install_dir: np_dir, + install_tag: 'tests', + exclude_directories: ['__pycache__'] +) compilers = { 'C': cc,