Search code examples
pythonpython-wheelsoftware-packagingpython-packaging

How to edit a wheel package (.whl)?


I have a python wheel package, when extracted I find some python code, I'd like to edit this code and re-generate the same .whl package again and test it to see the edits .. How do I do that?


Solution

  • You usually don't.

    Normally you get the source package instead of the wheel (or use development mode to install the package in editable form) and rebuild the wheel from that, e.g. by running python setup.py bdist_wheel.

    Have a look at https://packaging.python.org/distributing/ for a lot of information how to build those wheel packages.