diff options
| author | ?ric Araujo <merwok@netwok.org> | 2010-08-14 06:44:21 +0200 |
|---|---|---|
| committer | ?ric Araujo <merwok@netwok.org> | 2010-08-14 06:44:21 +0200 |
| commit | dc2c6c523eb196e0b2a9e2ecf640f95ed8864f3d (patch) | |
| tree | afdba7dd20afc2e45ab8604ca066566cbef6c20f /src/distutils2 | |
| parent | 882c332b096d5027bf9f649be9b5378f7ca253bb (diff) | |
| parent | 0ebd211ddfd8aeef9b0fd5c806929a1cfd03af67 (diff) | |
| download | disutils2-dc2c6c523eb196e0b2a9e2ecf640f95ed8864f3d.tar.gz | |
Merge
Diffstat (limited to 'src/distutils2')
| -rw-r--r-- | src/distutils2/converter/__init__.py | 8 | ||||
| -rw-r--r-- | src/distutils2/converter/refactor.py | 2 | ||||
| -rw-r--r-- | src/distutils2/tests/test_build_py.py | 5 | ||||
| -rw-r--r-- | src/distutils2/tests/test_build_scripts.py | 5 | ||||
| -rw-r--r-- | src/distutils2/tests/test_converter.py | 39 |
5 files changed, 8 insertions, 51 deletions
diff --git a/src/distutils2/converter/__init__.py b/src/distutils2/converter/__init__.py index a0f784e..e69de29 100644 --- a/src/distutils2/converter/__init__.py +++ b/src/distutils2/converter/__init__.py @@ -1,8 +0,0 @@ -"""distutils2.converter - -This package provide a refactoring tool to transform a -setuptools or distutils project into a distutils2 one. -""" - -from distutils2.converter.refactor import DistutilsRefactoringTool - diff --git a/src/distutils2/converter/refactor.py b/src/distutils2/converter/refactor.py index ada1a4d..28fbd44 100644 --- a/src/distutils2/converter/refactor.py +++ b/src/distutils2/converter/refactor.py @@ -1,7 +1,5 @@ """distutils2.converter.refactor -Provides DistutilsRefactoringTool, a class that register fixers used -to refactor distutils or setuptools packages into distutils2 ones. """ try: from lib2to3.refactor import RefactoringTool diff --git a/src/distutils2/tests/test_build_py.py b/src/distutils2/tests/test_build_py.py index aed24d3..54416c8 100644 --- a/src/distutils2/tests/test_build_py.py +++ b/src/distutils2/tests/test_build_py.py @@ -37,7 +37,10 @@ class BuildPyTestCase(support.TempdirManager, dist.script_name = os.path.join(sources, "setup.py") dist.command_obj["build"] = support.DummyCommand( force=0, - build_lib=destination) + build_lib=destination, + use_2to3_fixers=None, + convert_2to3_doctests=None, + use_2to3=False) dist.packages = ["pkg"] dist.package_data = {"pkg": ["README.txt"]} dist.package_dir = {"pkg": sources} diff --git a/src/distutils2/tests/test_build_scripts.py b/src/distutils2/tests/test_build_scripts.py index 6a724bd..5c7d616 100644 --- a/src/distutils2/tests/test_build_scripts.py +++ b/src/distutils2/tests/test_build_scripts.py @@ -49,7 +49,10 @@ class BuildScriptsTestCase(support.TempdirManager, dist.command_obj["build"] = support.DummyCommand( build_scripts=target, force=1, - executable=sys.executable + executable=sys.executable, + use_2to3=False, + use_2to3_fixers=None, + convert_2to3_doctests=None ) return build_scripts(dist) diff --git a/src/distutils2/tests/test_converter.py b/src/distutils2/tests/test_converter.py deleted file mode 100644 index c4cb387..0000000 --- a/src/distutils2/tests/test_converter.py +++ /dev/null @@ -1,39 +0,0 @@ -"""Tests for distutils.converter.""" -import os -import sys -from distutils2.converter import DistutilsRefactoringTool -from distutils2.tests.support import unittest - -_CURDIR = os.path.dirname(__file__) - -def _read_file(path): - # yes, distutils2 is 2.4 compatible, so, no with... - f = open(path) - try: - return f.read() - finally: - f.close() - - -class ConverterTestCase(unittest.TestCase): - - @unittest.skipIf(sys.version < '2.6', 'requires Python 2.6 or higher') - def test_conversions(self): - # for all XX_before in the conversions/ dir - # we run the refactoring tool - ref = DistutilsRefactoringTool() - convdir = os.path.join(_CURDIR, 'conversions') - for file_ in os.listdir(convdir): - if 'after' in file_ or not file_.endswith('py'): - continue - original = _read_file(os.path.join(convdir, file_)) - wanted = file_.replace('before', 'after') - wanted = _read_file(os.path.join(convdir, wanted)) - res = ref.refactor_string(original, 'setup.py') - self.assertEqual(str(res), wanted) - -def test_suite(): - return unittest.makeSuite(ConverterTestCase) - -if __name__ == '__main__': - unittest.main(defaultTest="test_suite") |
