Fix python thrift generation.

Review Request #1517 - Created Dec. 18, 2014 and updated

Information
Brian Wickman (Twitter)
pants
f49154f...
Reviewers
pants-reviews
jsirois

constants.py always imports ttypes. so if you have a .thrift file that only contains constants, apache_thrift_gen will generate a broken dist.

Before

11:14:03 00:01 [run]
============== test session starts ===============
platform darwin -- Python 2.7.5 -- py-1.4.26 -- pytest-2.6.4
plugins: cov, timeout
collected 0 items / 1 errors

                 ===================== ERRORS =====================
                  ERROR collecting src/test/python/apache/aurora/config/test_thrift.py 
                 src/test/python/apache/aurora/config/test_thrift.py:30: in <module>
                     from gen.apache.aurora.test.constants import INVALID_IDENTIFIERS, VALID_IDENTIFIERS
                 /private/var/folders/rd/_tjz8zts3g14md1kmf38z6w80000gn/T/tmpAttv8X/gen/apache/aurora/test/constants.py:8: in <module>
                     from ttypes import *
                 E   ImportError: No module named ttypes
                 ============ 1 error in 0.14 seconds =============

FAILURE

After

11:24:46 00:01 [run]
============== test session starts ===============
platform darwin -- Python 2.7.5 -- py-1.4.26 -- pytest-2.6.4
plugins: cov, timeout
collected 10 items

                 src/test/python/apache/aurora/config/test_thrift.py ..........

                 =========== 10 passed in 1.00 seconds ============

11:24:54 00:09 [junit]
11:24:54 00:09 [specs]
SUCCESS

Brian Wickman (Twitter)
Kevin Sweeney

Ship It!

John Sirois

Ship It!

John Sirois

In master @ https://github.com/pantsbuild/pants/commit/b11231b9ae203ae47ac38df7a44906900c7a3900
Please mark this review submitted.

I'll send an 0.0.27 version bump & CHANGELOG to prep a small release presently.

John Sirois

   

This is broken - sorry to miss.
I keep forgetting to cajole folks to report their branche's CI result to compound the error:
https://travis-ci.org/pantsbuild/pants/jobs/44500230

This file is generally missing the whole header boilerplate - which is partly checked for in a unit test - boilerplate like the top 6 lines here: https://github.com/pantsbuild/pants/blob/master/tests/python/pants_test/base/test_address.py#L6

  1. Fix is here: https://rbcommons.com/s/twitter/r/1519/

Loading...