Thanks to visit codestin.com
Credit goes to github.com

Skip to content

BUG: exclude __pycache__ directories from wheels#31397

Merged
charris merged 1 commit into
numpy:mainfrom
praneethhere:fix-wheel-exclude-pycache
May 7, 2026
Merged

BUG: exclude __pycache__ directories from wheels#31397
charris merged 1 commit into
numpy:mainfrom
praneethhere:fix-wheel-exclude-pycache

Conversation

@praneethhere
Copy link
Copy Markdown
Contributor

@praneethhere praneethhere commented May 6, 2026

Summary

Closes #31392

This updates the Meson install rules to exclude __pycache__ directories from wheel contents
Issue was reported for wheels containing bytecode cache files such as:

numpy/distutils/__pycache__/conv_template.cpython-311.pyc

__pycache__ directories are generated locally during Python execution/compilation and should not be copied into built wheels.

Validation

Created a local __pycache__ directory under an installed pure Python subdirectory:

python -c "import py_compile; py_compile.compile('numpy/f2py/__init__.py')"
find numpy/f2py -name "__pycache__" -o -name "*.pyc"

Built the wheel:

python -m build -w

Confirmed no __pycache__ entries were included:

unzip -l dist/*.whl | grep __pycache__
unzip -l dist/*.whl | grep "numpy/f2py/__pycache__"

Both grep commands returned no output

AI was used to help draft the PR description and to sanity check local verification steps. The code change was made and tested locally by me.

@charris
Copy link
Copy Markdown
Member

charris commented May 7, 2026

You should say whether or not you used AI in creating this. It looks good, but those are the rules.

@praneethhere
Copy link
Copy Markdown
Contributor Author

Thanks for reviewing
AI was used to help draft the PR description and to sanity check local verification steps. The code change was made and tested locally by me.

@charris charris added 00 - Bug 09 - Backport-Candidate PRs tagged should be backported labels May 7, 2026
@charris charris merged commit 5b4f1de into numpy:main May 7, 2026
86 checks passed
@charris
Copy link
Copy Markdown
Member

charris commented May 7, 2026

Thanks @praneethhere .

@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label May 8, 2026
charris added a commit that referenced this pull request May 8, 2026
BUG: exclude __pycache__ directories from wheels (#31397)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: __pycache__ directory included in 3.11 wheels

2 participants