egg_info directory in VC?
Asked Answered
N

1

22

Do you keep the foo.egg_info directory in version control?

Here an example where it would be nice to have it in VC:

  1. pip install -e foo
  2. Someone else adds a new EntryPoint (pkg_resource)
  3. You update the code and pull the new EntryPoint (file foo.egg-info/entry_points.txt)
  4. The new EntryPoint is available without calling setup.py again
Nardoo answered 15/10, 2013 at 7:9 Comment(4)
That'd be an irresponsible release; if any feature changes in a package, you need to update the version number. How else will you know that you have the right feature set installed?Dobson
Rule of thumb: do not commit generated information. Check in the source only.Dobson
If you are using eggs from VC, then you have already installed these as development eggs; just re-run setup.py after updating the working copy. It is not that arduous. :-)Dobson
@MartijnPieters thank you for your comments. I was unsure, with the feeling that this directory should not be in VC. If you answer the question in an answer, I can accept it.Nardoo
D
13

If all that was updated in the package was the addition of an entry point, that'd be an irresponsible release; if any feature changes in a package, you need to update the version number. How else will you know that you have the right feature set installed?

If you are using eggs from a VCS, then pip already takes care of updating the egg info for you. Just run pip install -e foo again; it'll update the package and re-generate the egg info for you:

$ bin/pip install -e git+https://github.com/mjpieters/setuptools_subversion.git#egg=setuptools_subversion
Obtaining setuptools-subversion from git+https://github.com/mjpieters/setuptools_subversion.git#egg=setuptools_subversion
  Cloning https://github.com/mjpieters/setuptools_subversion.git to /tmp/pip-e/src/setuptools-subversion
  Running setup.py egg_info for package setuptools-subversion

Installing collected packages: setuptools-subversion
  Running setup.py develop for setuptools-subversion

    Creating /private/tmp/pip-e/lib/python2.7/site-packages/setuptools-subversion.egg-link (link to .)
    Adding setuptools-subversion 3.2 to easy-install.pth file

    Installed /private/tmp/pip-e/src/setuptools-subversion
Successfully installed setuptools-subversion
Cleaning up...
$ bin/pip install -e git+https://github.com/mjpieters/setuptools_subversion.git#egg=setuptools_subversion
Obtaining setuptools-subversion from git+https://github.com/mjpieters/setuptools_subversion.git#egg=setuptools_subversion
  Updating /tmp/pip-e/src/setuptools-subversion clone
  Running setup.py egg_info for package setuptools-subversion

Installing collected packages: setuptools-subversion
  Running setup.py develop for setuptools-subversion

    Creating /private/tmp/pip-e/lib/python2.7/site-packages/setuptools-subversion.egg-link (link to .)
    setuptools-subversion 3.2 is already the active version in easy-install.pth

    Installed /private/tmp/pip-e/src/setuptools-subversion
Successfully installed setuptools-subversion
Cleaning up...

Note the second invokation; instead of 'cloning', the second run states pip is 'updating' the VCS clone, after which setup.py egg_info is run again.

The egg info metadata is entirely generated from source; only commit the source to the VCS and leave the egg info out of it entirely. That way you can still generate platform-specific dependencies as well, for example.

Dobson answered 15/10, 2013 at 8:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.