Fixup GoFetch to handle relative imports.

Review Request #2854 - Created Sept. 21, 2015 and submitted

Information
John Sirois
pants
jsirois/issues/2229
2229, 2230
2857
4f5fb03...
Reviewers
pants-reviews
kwlzn, mateor, zundel
Although relative imports are considered obsolete and generally are
frowned upon - they exist in the wild.  As such pants must handle
resolution of remote packages that contain relative imports.

This change takes a fairly dumb stance and assumes relative imports must
exist within the package just resolved and thus simply excludes these
imports from further recursive rounds of resolution.

A unit test is added to confirm relative imports are ignored in
resolution rounds and that a known real remote lib with relative imports
resolves and builds correctly.

 contrib/go/examples/3rdparty/go/github.com/robertkrimen/otto/BUILD               |  6 ++++++
 contrib/go/src/python/pants/contrib/go/tasks/go_fetch.py                         | 11 ++++++++++-
 contrib/go/tests/python/pants_test/contrib/go/tasks/test_go_fetch.py             | 20 ++++++++++++++++++++
 contrib/go/tests/python/pants_test/contrib/go/tasks/test_go_fetch_integration.py | 10 +++++++++-
 4 files changed, 45 insertions(+), 2 deletions(-)

Locally ran green: ./pants clean-all test contrib/go::

CI went green here:
https://travis-ci.org/pantsbuild/pants/builds/81465843

Vinny Fuentes
Mateo Rodriguez
Eric Ayers
John Sirois
John Sirois
John Sirois
Review request changed

Status: Closed (submitted)

Loading...