[Python-checkins] distutils2: few changes
tarek.ziade
python-checkins at python.org
Thu Aug 19 08:34:14 CEST 2010
tarek.ziade pushed 9b4c69f0d96b to distutils2:
http://hg.python.org/distutils2/rev/9b4c69f0d96b
changeset: 578:9b4c69f0d96b
parent: 576:6ecc55d25837
user: Zubin Mithra <zubin.mithra at gmail.com>
date: Sat Aug 14 10:05:18 2010 +0530
summary: few changes
files: src/distutils2/converter/__init__.py, src/distutils2/converter/refactor.py, src/distutils2/tests/test_build_py.py, src/distutils2/tests/test_build_scripts.py, src/distutils2/tests/test_converter.py
diff --git a/src/distutils2/converter/__init__.py b/src/distutils2/converter/__init__.py
--- 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
--- 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
--- a/src/distutils2/tests/test_build_py.py
+++ b/src/distutils2/tests/test_build_py.py
@@ -37,7 +37,10 @@
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
--- a/src/distutils2/tests/test_build_scripts.py
+++ b/src/distutils2/tests/test_build_scripts.py
@@ -49,7 +49,10 @@
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
--- 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")
--
Repository URL: http://hg.python.org/distutils2
More information about the Python-checkins
mailing list