diff --git a/pex/bdist_pex.py b/pex/bdist_pex.py new file mode 100644 index 000000000..71262b165 --- /dev/null +++ b/pex/bdist_pex.py @@ -0,0 +1,29 @@ +# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). +# Licensed under the Apache License, Version 2.0 (see LICENSE). + +from __future__ import absolute_import, print_function + +from distutils.core import Command +from distutils import log as logger + +from .pex_builder import PEXBuilder + + +class bdist_pex(Command): + description = 'create a pex distribution' + user_options = [] + + def initialize_options(self): + pass + + def finalize_options(self): + pass + + def run(self): + pex_builder = PEXBuilder() + pexfile_path = self._get_pexfile_path() + logger.info('creating %s', pexfile_path) + pex_builder.build(pexfile_path) + + def _get_pexfile_path(self): + return 'dist/foo.pex' diff --git a/setup.py b/setup.py index b50c313e2..01e8883f0 100644 --- a/setup.py +++ b/setup.py @@ -55,5 +55,8 @@ 'console_scripts': [ 'pex = pex.bin.pex:main', ], + 'distutils.commands': [ + 'bdist_pex = pex.bdist_pex:bdist_pex', + ], }, )