diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2014-12-23 10:24:46 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2014-12-23 10:24:46 -0500 |
commit | df765dcb6204366f4662004217997af35590fb9b (patch) | |
tree | 1f7dbb10b5f09cb327cae8b9fdf777a19c192589 /setuptools/command/build_ext.py | |
parent | 3ade3c11402c161a623e54502472fdd6cc7bd0dc (diff) | |
download | external_python_setuptools-df765dcb6204366f4662004217997af35590fb9b.tar.gz external_python_setuptools-df765dcb6204366f4662004217997af35590fb9b.tar.bz2 external_python_setuptools-df765dcb6204366f4662004217997af35590fb9b.zip |
Extract logic for getting the extensions for outputs.
Diffstat (limited to 'setuptools/command/build_ext.py')
-rw-r--r-- | setuptools/command/build_ext.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/setuptools/command/build_ext.py b/setuptools/command/build_ext.py index 78155223..2df3bc70 100644 --- a/setuptools/command/build_ext.py +++ b/setuptools/command/build_ext.py @@ -200,17 +200,20 @@ class build_ext(_build_ext): return _build_ext.get_outputs(self) + self.__get_stubs_outputs() def __get_stubs_outputs(self): - fn_exts = ['.py', '.pyc'] - if self.get_finalized_command('build_py').optimize: - fn_exts.append('.pyo') ns_ext_bases = ( os.path.join(self.build_lib, *ext._full_name.split('.')) for ext in self.extensions if ext._needs_stub ) - pairs = itertools.product(ns_ext_bases, fn_exts) + pairs = itertools.product(ns_ext_bases, self.__get_output_extensions()) return (base + fnext for base, fnext in pairs) + def __get_output_extensions(self): + yield '.py' + yield '.pyc' + if self.get_finalized_command('build_py').optimize: + yield '.pyo' + def write_stub(self, output_dir, ext, compile=False): log.info("writing stub loader for %s to %s", ext._full_name, output_dir) |