Instead of always bootstrapping to eggs, only do this in dev mode.

Review Request #272 — Created April 23, 2014 and submitted

jsirois
pants
jsirois/bootstrap/egg_option
81
pants-reviews
benjyw, ity, patricklaw, tejal
commit 045a10f5c7d2f603712c901addc7e12096c415d3
Author: John Sirois <jsirois@twitter.com>
Date:   Wed Apr 23 13:01:45 2014 -0600

    Instead of always bootstrapping to eggs, only do this in dev mode.
    
    Since egg bootstrapping is just there to support IDEs - implying
    PANTS_DEV mode makes sense to be using, and, more importantly,
    since travis-ci runs choke on the generated eggs almost 100% of the
    time [1], just use eggs in dev mode.
    
    [1] pip fails like so:
      Running setup.py install for twitter.common.dirutil
    
        installing library code to build/bdist.linux-x86_64/egg
        removing 'build/bdist.linux-x86_64/egg' (and everything under it)
        Processing twitter.common.dirutil-0.1.3-py2.7.egg
        Removing /home/travis/build/pantsbuild/pants/build-support/pants_deps.venv/lib/python2.7/site-packages/twitter.common.dirutil-0.1.3-py2.7.egg
        twitter.common.dirutil 0.1.3 is already the active version in easy-install.pth
    
        Installed /home/travis/build/pantsbuild/pants/build-support/pants_deps.venv/lib/python2.7/site-packages/twitter.common.dirutil-0.1.3-py2.7.egg
        Processing dependencies for twitter.common.dirutil==0.1.3
        Traceback (most recent call last):
          File "<string>", line 1, in <module>
          File "/home/travis/build/pantsbuild/pants/build-support/pants_deps.venv/build/twitter.common.dirutil/setup.py", line 22, in <module>
            'zip_safe': True}
          File "/usr/lib/python2.7/distutils/core.py", line 152, in setup
            dist.run_commands()
          File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
            self.run_command(cmd)
          File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
            cmd_obj.run()
          File "/home/travis/build/pantsbuild/pants/build-support/pants_deps.venv/local/lib/python2.7/site-packages/setuptools/command/install.py", line 74, in run
            self.do_egg_install()
          File "/home/travis/build/pantsbuild/pants/build-support/pants_deps.venv/local/lib/python2.7/site-packages/setuptools/command/install.py", line 97, in do_egg_install
            cmd.run()
          File "/home/travis/build/pantsbuild/pants/build-support/pants_deps.venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 358, in run
            self.easy_install(spec, not self.no_deps)
          File "/home/travis/build/pantsbuild/pants/build-support/pants_deps.venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 574, in easy_install
            return self.install_item(None, spec, tmpdir, deps, True)
          File "/home/travis/build/pantsbuild/pants/build-support/pants_deps.venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 625, in install_item
            self.process_distribution(spec, dist, deps)
          File "/home/travis/build/pantsbuild/pants/build-support/pants_deps.venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 671, in process_distribution
            [requirement], self.local_index, self.easy_install
          File "/home/travis/build/pantsbuild/pants/build-support/pants_deps.venv/local/lib/python2.7/site-packages/pkg_resources.py", line 593, in resolve
            requirements.extend(dist.requires(req.extras)[::-1])
          File "/home/travis/build/pantsbuild/pants/build-support/pants_deps.venv/local/lib/python2.7/site-packages/pkg_resources.py", line 2251, in requires
            dm = self._dep_map
          File "/home/travis/build/pantsbuild/pants/build-support/pants_deps.venv/local/lib/python2.7/site-packages/pkg_resources.py", line 2237, in _dep_map
            for extra,reqs in split_sections(self._get_metadata(name)):
          File "/home/travis/build/pantsbuild/pants/build-support/pants_deps.venv/local/lib/python2.7/site-packages/pkg_resources.py", line 2673, in split_sections
            for line in yield_lines(s):
          File "/home/travis/build/pantsbuild/pants/build-support/pants_deps.venv/local/lib/python2.7/site-packages/pkg_resources.py", line 1949, in yield_lines
            for ss in strs:
          File "/home/travis/build/pantsbuild/pants/build-support/pants_deps.venv/local/lib/python2.7/site-packages/pkg_resources.py", line 2265, in _get_metadata
            for line in self.get_metadata_lines(name):
          File "/home/travis/build/pantsbuild/pants/build-support/pants_deps.venv/local/lib/python2.7/site-packages/pkg_resources.py", line 1329, in get_metadata_lines
            return yield_lines(self.get_metadata(name))
          File "/home/travis/build/pantsbuild/pants/build-support/pants_deps.venv/local/lib/python2.7/site-packages/pkg_resources.py", line 1321, in get_metadata
            return self._get(self._fn(self.egg_info,name))
          File "/home/travis/build/pantsbuild/pants/build-support/pants_deps.venv/local/lib/python2.7/site-packages/pkg_resources.py", line 1385, in _get
            return self.loader.get_data(path)
        zipimport.ZipImportError: bad local file header in /home/travis/build/pantsbuild/pants/build-support/pants_deps.venv/lib/python2.7/site-packages/twitter.common.dirutil-0.1.3-py2.7.egg

 pants | 35 +++++++++++++++++++++++++----------
 1 file changed, 25 insertions(+), 10 deletions(-)


  • 0
  • 0
  • 0
  • 1
  • 1
Description From Last Updated
JS
  1. Motivated by a bleeding travis-ci over the last few days.
  2. 
      
JS
JS
JS
  1. This did promptly get some green:
    diff1:
      https://travis-ci.org/pantsbuild/pants/builds/23617331
    diff2 (1 shard sdist-fetch timed out but thats a sep. issue):
      https://travis-ci.org/pantsbuild/pants/builds/23617506
      
  2. 
      
BE
  1. 
      
  2. pants (Diff revision 2)
     
     
    While we're at it, can we move this out of build-support and into some dot dir, like .pants.venv? 
    
    I'd rather not mix checked-in files and build byproducts under build-support.
    1. I'll beg-off mixing that change in and follow-up.  There is a virtualenv-itself bootstrap going on in that dir currently too.
  3. 
      
JS
  1. Thanks - submitted.
  2. 
      
JS
Review request changed

Status: Closed (submitted)

Loading...