Fixup SetupPy handling of exported thrift.

Review Request #2511 - Created July 22, 2015 and submitted

Information
John Sirois
pants
jsirois/issues/1805/fix_setup_py
1805, 1847
2509
b6e7f93...
Reviewers
pants-reviews
benjyw, stuhood, tejal
SetupPy was attempting to create a PythonThriftBuilder with an invalid
set of constructor args.  This change adds a test that exercises this
codepath in addition to the path for exported antlr libraries.

In the course of creating a testable PythonThriftBuilder, extract
BinaryUtil.Factory and ThriftBinary.Factory subsystems to both
encapsulate options and allow for directly constructable BinaryUtil and
ThriftBinary objects.

Some further file move cleanups are marked TODO in favor of keeping the
scope of this review from ballooning farther than it already has.

 migrations/options/src/python/migrate_config.py                  | 12 +++++++++
 src/python/pants/BUILD                                           |  4 +++
 src/python/pants/backend/codegen/tasks/BUILD                     |  3 ++-
 src/python/pants/backend/codegen/tasks/apache_thrift_gen.py      | 19 +++++++-------
 src/python/pants/backend/codegen/tasks/protobuf_gen.py           | 10 +++++++-
 src/python/pants/backend/codegen/tasks/ragel_gen.py              | 21 ++++++++++------
 src/python/pants/backend/python/BUILD                            |  1 +
 src/python/pants/backend/python/code_generator.py                |  9 +++----
 src/python/pants/backend/python/python_chroot.py                 | 22 ++++++++++------
 src/python/pants/backend/python/tasks/BUILD                      |  6 +++--
 src/python/pants/backend/python/tasks/python_task.py             | 29 +++++++++++++++------
 src/python/pants/backend/python/tasks/setup_py.py                | 29 +++++++++++++--------
 src/python/pants/backend/python/thrift_builder.py                | 24 +++++++++++-------
 src/python/pants/binary_util.py                                  | 68 +++++++++++++++++++++++++++++++-------------------
 src/python/pants/option/global_options.py                        |  8 ------
 src/python/pants/thrift_util.py                                  | 56 +++++++++++++++++++++++++++++++++++------
 tests/python/pants_test/backend/python/tasks/python_task_test.py | 10 +-------
 tests/python/pants_test/backend/python/tasks/test_setup_py.py    | 56 ++++++++++++++++++++++++++++++++++++++---
 tests/python/pants_test/cache/test_cache_setup.py                |  1 +
 tests/python/pants_test/test_binary_util.py                      | 62 ++++++++++++++++++++++-----------------------
 20 files changed, 305 insertions(+), 145 deletions(-)
CI went green here:
  https://travis-ci.org/pantsbuild/pants/builds/72214777

Issues

  • 0
  • 0
  • 1
  • 1
Description From Last Updated
John Sirois
Benjy Weinberger
Stu Hood
John Sirois
Tejal Desai
John Sirois
John Sirois
Stu Hood
John Sirois
John Sirois
Review request changed

Status: Closed (submitted)

Loading...