diff options
author | Andrey Golovizin <ag@sologoc.com> | 2012-03-28 21:51:05 +0400 |
---|---|---|
committer | Andrey Golovizin <ag@sologoc.com> | 2012-03-28 21:51:05 +0400 |
commit | e4cd72356bec95517fbf20b0c29599e920c97827 (patch) | |
tree | f3ef8f0caf274aae8340546ce4dcf9ef43ab8c7c | |
parent | 3983ae3636eb286c0610f113e77356435d686018 (diff) | |
download | nose-e4cd72356bec95517fbf20b0c29599e920c97827.tar.gz |
Add support for 2to3 to nosetests setuptools command.
-rw-r--r-- | nose/commands.py | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/nose/commands.py b/nose/commands.py index b819b38..3b43ed0 100644 --- a/nose/commands.py +++ b/nose/commands.py @@ -113,11 +113,27 @@ else: def run(self): """ensure tests are capable of being run, then run nose.main with a reconstructed argument list""" - self.run_command('egg_info') + if getattr(self.distribution, 'use_2to3', False): + # If we run 2to3 we can not do this inplace: - # Build extensions in-place - self.reinitialize_command('build_ext', inplace=1) - self.run_command('build_ext') + # Ensure metadata is up-to-date + self.reinitialize_command('build_py', inplace=0) + self.run_command('build_py') + bpy_cmd = self.get_finalized_command("build_py") + build_path = bpy_cmd.build_lib + + # Build extensions + self.reinitialize_command('egg_info', egg_base=build_path) + self.run_command('egg_info') + + self.reinitialize_command('build_ext', inplace=0) + self.run_command('build_ext') + else: + self.run_command('egg_info') + + # Build extensions in-place + self.reinitialize_command('build_ext', inplace=1) + self.run_command('build_ext') if self.distribution.install_requires: self.distribution.fetch_build_eggs( @@ -126,7 +142,8 @@ else: self.distribution.fetch_build_eggs( self.distribution.tests_require) - argv = ['nosetests'] + ei_cmd = self.get_finalized_command("egg_info") + argv = ['nosetests', ei_cmd.egg_base] for (option_name, cmd_name) in self.option_to_cmds.items(): if option_name in option_blacklist: continue |