Skip to content

whisper: only package mlx_whisper in the wheel - #1455

Open
Kayvan-Zahiri wants to merge 1 commit into
ml-explore:mainfrom
Kayvan-Zahiri:whisper-package-only
Open

Kayvan-Zahiri wants to merge 1 commit into
ml-explore:mainfrom
Kayvan-Zahiri:whisper-package-only

Conversation

@Kayvan-Zahiri

Copy link
Copy Markdown

The mlx-whisper 0.4.3 wheel on PyPI installs a top-level build directory next to mlx_whisper:

$ unzip -l mlx_whisper-0.4.3-py3-none-any.whl | awk '{print $4}' | cut -d/ -f1 | sort | uniq -c
     39 build
     17 mlx_whisper
      5 mlx_whisper-0.4.3.dist-info

setup.py uses find_namespace_packages() with no filter. Namespace discovery also picks up directories without an __init__.py, so once a previous build has left whisper/build/lib/mlx_whisper/... behind, the next build packages it as build.lib.mlx_whisper. It reproduces locally: building twice in a clean checkout of main, the second wheel has 12 files under build/.

This restricts discovery to find_namespace_packages(include=["mlx_whisper*"]), which keeps the mlx_whisper.assets data and drops everything else. With the change, both the first and second builds contain only mlx_whisper, and the files under mlx_whisper/ are identical to a first build of main.

find_namespace_packages() with no include picks up a leftover build/
directory, so the mlx-whisper 0.4.3 wheel ships build/lib/... as a
top-level namespace package.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant