[pkg] use argument *package_data* stable
authorAlain Leufroy <alain.leufroy@logilab.fr>
Fri, 15 Oct 2010 19:48:58 +0200
branchstable
changeset 6516 6b2e1e8d3a22
parent 6514 f328ec853e18
child 6517 c991ad161d8f
[pkg] use argument *package_data* Use the dedicaded setup's argument for files that are copied in the package directory.
__pkginfo__.py
setup.py
--- a/__pkginfo__.py	Fri Oct 15 17:00:09 2010 +0200
+++ b/__pkginfo__.py	Fri Oct 15 19:48:58 2010 +0200
@@ -96,7 +96,13 @@
 else:
     pydir = join('python' + _pyversion, 'site-packages')
 
+# data files that shall be copied into the main package directory
+package_data = {
+    'cubicweb.web.views':['*.pt'],
+    }
+
 try:
+    # data files that shall be copied outside the main package directory
     data_files = [
         # server data
         [join('share', 'cubicweb', 'schemas'),
@@ -119,10 +125,6 @@
          [join(_wdocimages_dir, fname) for fname in listdir(_wdocimages_dir)]],
         [join('share', 'cubicweb', 'cubes', 'shared', 'i18n'),
          [join(_i18n_dir, fname) for fname in listdir(_i18n_dir)]],
-        # XXX: drop .pt files
-        [join('lib', pydir, 'cubicweb', 'web', 'views'),
-         [join(_views_dir, fname) for fname in listdir(_views_dir)
-          if fname.endswith('.pt')]],
         # skeleton
         ]
 except OSError:
--- a/setup.py	Fri Oct 15 17:00:09 2010 +0200
+++ b/setup.py	Fri Oct 15 19:48:58 2010 +0200
@@ -61,7 +61,7 @@
 data_files = getattr(__pkginfo__, 'data_files', None)
 subpackage_of = getattr(__pkginfo__, 'subpackage_of', None)
 ext_modules = getattr(__pkginfo__, 'ext_modules', None)
-
+package_data = getattr(__pkginfo__, 'package_data', {})
 
 BASE_BLACKLIST = ('CVS', 'debian', 'dist', 'build', '__buildlog')
 IGNORED_EXTENSIONS = ('.pyc', '.pyo', '.elc')
@@ -194,6 +194,7 @@
     if USE_SETUPTOOLS:
         kwargs['install_requires'] = install_requires
     kwargs['packages'] = packages
+    kwargs['package_data'] = package_data
     return setup(name=distname, version=version, license=license, url=web,
                  description=description, long_description=long_description,
                  author=author, author_email=author_email,