0

I'm developing a python package foo. My project structure looks like this:

.
├── foo
│   ├── foo
│   │   ├── bar.py
│   │   ├── foo.py
│   │   ├── __init__.py
│   ├── README.md
│   └── setup.py
├── footest
│   ├── test.py

test.py only has 1 line: import foo

In order for test.py to be able to import the package foo I install it with the command pip3 install -e foo.

Now a new folder called foo.egg-info is created under foo/

.
├── foo
│   ├── foo
│   │   ├── bar.py
│   │   ├── foo.py
│   │   ├── __init__.py
│   ├── foo.egg-info
│   │   ├── dependency_links.txt
│   │   ├── PKG-INFO.txt
│   │   ├── requires.txt
│   │   ├── SOURCES.txt
│   │   ├── top_level.txt
│   ├── README.md
│   └── setup.py
├── footest
│   ├── test.py

What's the purpose of this folder? I tried deleting it and test.py still ran properly. Is is just leftover garbage, similar to the .o files when compiling C projects? If so, is there a way to automatically remove it?

Tirafesi
  • 1,087
  • 14
  • 24
  • Not sure if any of these exactly answer your question on their own, but a quick read of each of them will probably clear this up for you: https://stackoverflow.com/questions/2051192/what-is-a-python-egg, https://stackoverflow.com/questions/4384402/what-is-the-point-of-python-egg-files, https://stackoverflow.com/questions/256417/python-packages-and-egg-info-directories – benvc Oct 25 '19 at 15:54

1 Answers1

0

The package.egg-info saves meta data about your installed package like version. It is used when you for example uninstall it, or "pip list" to see what is installed.

you can open it and take a look.

Lior Cohen
  • 5,046
  • 1
  • 11
  • 26