Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I convert a .whl to an .egg?

Tags:

python

I want to create a .egg file from a .whl. Is this possible?

I have found answers for doing the opposite (.whl from .egg) using the wheel package, but I cannot figure out how to properly do the reverse.

like image 986
Jonathan Kimball Galloway Avatar asked Apr 17 '15 15:04

Jonathan Kimball Galloway


People also ask

How do you make a egg file in Python?

EGG files can be created using the distutils package available by Python. Another tool that can create and open EGG files is SetupTools. EGG files can be installed as a package using easy_install.

What is the difference between Python egg and wheel?

Wheel is a distribution format, i.e a packaging format. 1 Egg was both a distribution format and a runtime installation format (if left zipped), and was designed to be importable. Wheel archives do not include . pyc files.

What is PIP egg?

A pip is the first tiny hole in the egg that a chick makes as it begins to peck its way out.


1 Answers

You can use humpty, a command-line utility available on PyPI to do exactly that.

For instance

humpty -d . publicsuffixlist-0.2.8-py2.py3-none-any.whl

will generate a publicsuffixlist-0.2.8-py2.7.egg.

I wrote humpty because I needed to convert a .whl to a .egg. The task seemed doable, but I did not find any existing utilities or libraries which did the job.

Note that you can also do the opposite with Wheel convert which converts from .egg to .whl.

like image 51
dairiki Avatar answered Sep 18 '22 21:09

dairiki