I am currently working on implementing a "wheel repack" command which lets you unpack a wheel, modify it and then repack it again while keeping the wheel RECORD consistent.
I think this is something that would solve your use case.

ke, 2018-05-30 kello 10:07 +0200, Michal Petrucha kirjoitti:
Hello everyone,

I've been looking for a way to ensure that certain modules don't end
up in a wheel, while the rest of the package they reside in does. If I
only cared about sdist, I could add a MANIFEST.in, in which I'd
exclude those specific files, however, unfortunately, MANIFEST.in has
no effect on bdists (at least of the wheel kind).

The use case is that our application auto-generates a parser and lexer
with ply, and that parser might not work with different versions of
ply. Since we don't have a whole lot of control over what version
users have installed in their environments, we'd like to generate
those modules in the target environment.

I took a deep dive into distutils and setuptools, and as far as I can
see, any Python modules residing inside a package listed in the
packages argument to setup() are included in the distribution
unconditionally. Searching this mailing list only reveals a short
thread from nine years ago [1] without any solution...

For now, the easiest hacky solution for me is to add a couple of
os.remove calls to setup.py, but I'm not a big fan of setup.py messing
with the source tree.

And as a follow-up question, is there any post-installation hook that
we could use to trigger regeneration of those files?

Any ideas?

Michal


[1]: https://mail.python.org/mm3/archives/list/distutils-sig@python.org/message/NB7NBE2IE7N4KZQZW7IWZ2XE4RQ7DTEG/

--
Distutils-SIG mailing list -- distutils-sig@python.org
To unsubscribe send an email to distutils-sig-leave@python.org
https://mail.python.org/mm3/mailman3/lists/distutils-sig.python.org/
Message archived at https://mail.python.org/mm3/archives/list/distutils-sig@python.org/message/V2LCHK3672DLQ7BZLPH5S46O4A6RYFRC/