Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do I need *.egg-info directories when using setuptools/distribute to create a python package

I have a "standard" python package layout like this:

  • setup.py - using setuptools
  • README
  • src/moduleA
  • test/

However, when I execute setup.py it decides to create the directory src/moduleA.egg-info.

The question is, do I need to worry about the contents of this directory and check it in with the rest of my code, or should I just rely on setuptools/distribute to regenerate it? It seems that all the information in the .egg-info directory comes from the config in setup.py anyway.

like image 228
Nick Sonneveld Avatar asked Aug 26 '10 13:08

Nick Sonneveld


People also ask

What is egg-info directory?

egg-info format: a file or directory placed adjacent to the project's code and resources, that directly contains the project's metadata.

What is Python eggs folder?

egg file is a distribution format for Python packages. It's just an alternative to a source code distribution or Windows exe . But note that for pure Python , the . egg file is completely cross-platform.

What does Python setuptools setup do?

setuptools allows you to install a package without copying any files to your interpreter directory (e.g. the site-packages directory). This allows you to modify your source code and have the changes take effect without you having to rebuild and reinstall.

How do you distribute a project in Python?

Use PyInstaller, py2exe, Nuitka, or another bundling solution. The most convenient way to deliver a Python application to a user is to provide them with an executable—either a single file or a directory with an easily identified executable somewhere in it.


1 Answers

The automatically generated bits don't need to be checked in, unless you're actually extending setuptools itself as part of your build process.

However, if you're putting files of your own in .egg-info (like i18n resources for EggTranslations), then those should definitely be checked in, since setuptools obviously isn't going to be able to regenerate them for you. ;-)

like image 107
PJ Eby Avatar answered Nov 15 '22 09:11

PJ Eby