Ejemplo n.º 1
0
def main():
  parser = configure_clp()
  options, args = parser.parse_args()
  verbosity = 5 if options.verbosity else -1

  with Tracer.env_override(
      PEX_VERBOSE=verbosity,
      TWITTER_COMMON_PYTHON_HTTP=verbosity,
      PYTHON_VERBOSE=verbosity):

    pex_builder = build_pex(args, options)

    if options.pex_name is not None:
      log('Saving PEX file to %s' % options.pex_name, v=options.verbosity)
      tmp_name = options.pex_name + '~'
      safe_delete(tmp_name)
      pex_builder.build(tmp_name)
      os.rename(tmp_name, options.pex_name)
      return 0

    if options.platform != Platform.current():
      log('WARNING: attempting to run PEX with differing platform!')

    pex_builder.freeze()

    log('Running PEX file at %s with args %s' % (pex_builder.path(), args), v=options.verbosity)
    pex = PEX(pex_builder.path(), interpreter=pex_builder.interpreter)
    return pex.run(args=list(args))
Ejemplo n.º 2
0
def main():
  parser = configure_clp()
  options, args = parser.parse_args()
  verbosity = 5 if options.verbosity else -1

  with Tracer.env_override(
      PEX_VERBOSE=verbosity,
      TWITTER_COMMON_PYTHON_HTTP=verbosity,
      PYTHON_VERBOSE=verbosity):

    sys.exit(build_pex(args, options))
Ejemplo n.º 3
0
from twitter.common.python.tracer import Tracer

__all__ = ('TRACER', )

TRACER = Tracer(predicate=Tracer.env_filter('TWITTER_COMMON_PYTHON_HTTP'),
                prefix='twitter.common.python.http: ')
Ejemplo n.º 4
0
from twitter.common.python.tracer import Tracer

__all__ = ("TRACER",)

TRACER = Tracer(predicate=Tracer.env_filter("TWITTER_COMMON_PYTHON_HTTP"), prefix="twitter.common.python.http: ")