[pypy-svn] r75266 - in pypy/branch/sys-prefix/pypy/tool: . test

antocuni at codespeak.net antocuni at codespeak.net
Fri Jun 11 13:52:10 CEST 2010


Author: antocuni
Date: Fri Jun 11 13:52:09 2010
New Revision: 75266

Modified:
   pypy/branch/sys-prefix/pypy/tool/package.py
   pypy/branch/sys-prefix/pypy/tool/test/test_package.py
Log:
fix package.py for the new directory layout


Modified: pypy/branch/sys-prefix/pypy/tool/package.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/tool/package.py	(original)
+++ pypy/branch/sys-prefix/pypy/tool/package.py	Fri Jun 11 13:52:09 2010
@@ -38,14 +38,10 @@
         raise PyPyCNotFound('Please compile pypy first, using translate.py')
     builddir = udir.ensure("build", dir=True)
     pypydir = builddir.ensure(name, dir=True)
-    shutil.copytree(str(basedir.join('lib-python')),
-                    str(pypydir.join('lib-python')),
-                    ignore=ignore_patterns('.svn', '*.pyc', '*~'))
-    # Careful: to copy pypy/lib, copying just the svn-tracked files
+    # Careful: to copy lib_pypy, copying just the svn-tracked files
     # would not be enough: there are also ctypes_config_cache/_*_cache.py.
-    pypydir.ensure('pypy', dir=True)
-    shutil.copytree(str(basedir.join('pypy', 'lib')),
-                    str(pypydir.join('pypy', 'lib')),
+    shutil.copytree(str(basedir.join('lib')),
+                    str(pypydir.join('lib')),
                     ignore=ignore_patterns('.svn', 'py', '*.pyc', '*~'))
     for file in ['LICENSE', 'README']:
         shutil.copy(str(basedir.join(file)), str(pypydir))

Modified: pypy/branch/sys-prefix/pypy/tool/test/test_package.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/tool/test/test_package.py	(original)
+++ pypy/branch/sys-prefix/pypy/tool/test/test_package.py	Fri Jun 11 13:52:09 2010
@@ -2,6 +2,7 @@
 import py
 from pypy.tool.autopath import pypydir
 from pypy.tool.package import main
+from pypy.module.sys.version import PYPY_VERSION, CPYTHON_VERSION
 import tarfile, os
 
 def test_dir_structure():
@@ -14,15 +15,18 @@
         fake_pypy_c = False
     try:
         builddir = main(py.path.local(pypydir).dirpath(), 'test')
-        assert builddir.join('test', 'lib-python', '2.5.2', 'test').check()
-        assert builddir.join('test', 'bin', 'pypy-c').check()
-        assert builddir.join('test', 'pypy', 'lib', 'syslog.py').check()
-        assert not builddir.join('test', 'pypy', 'lib', 'py').check()
-        assert not builddir.join('test', 'pypy', 'lib', 'ctypes_configure').check()
-        assert builddir.join('test', 'LICENSE').check()
-        assert builddir.join('test', 'README').check()
+        prefix = builddir.join('test')
+        pypyxy = 'pypy%d.%d' % PYPY_VERSION[:2]
+        cpyver = '%d.%d.%d' % CPYTHON_VERSION[:3]
+        assert prefix.join('lib', pypyxy, 'lib-python', cpyver, 'test').check()
+        assert prefix.join('bin', 'pypy-c').check()
+        assert prefix.join('lib', pypyxy, 'lib_pypy', 'syslog.py').check()
+        assert not prefix.join('lib', pypyxy, 'lib_pypy', 'py').check()
+        assert not prefix.join('lib', pypyxy, 'lib_pypy', 'ctypes_configure').check()
+        assert prefix.join('LICENSE').check()
+        assert prefix.join('README').check()
         th = tarfile.open(str(builddir.join('test.tar.bz2')))
-        assert th.getmember('test/pypy/lib/syslog.py')
+        assert th.getmember('test/lib/%s/lib_pypy/syslog.py' % pypyxy)
     finally:
         if fake_pypy_c:
             pypy_c.remove()



More information about the Pypy-commit mailing list