Re: [Nevow-commits] r5247 - Change package_data so that distutils and setuptools include the athena_private
* mg@divmod.net
resource correctly.
Note: the actual package data is the athena_private directory in the nevow package, not the files in the non-existant nevow.athena_private package.
Modified: trunk/Nevow/setupcommon.py ============================================================================== --- trunk/Nevow/setupcommon.py (original) +++ trunk/Nevow/setupcommon.py Thu Mar 9 09:12:35 2006 @@ -17,6 +17,7 @@ 'freeform-default.css' ], 'nevow': [ + 'athena_private/*', 'athena.js', 'defer.js', 'divmod.js', @@ -48,7 +49,4 @@ 'test_object.js', 'testsupport.js', ], - 'nevow.athena_private': [ - 'connection-status-down.png', - ], }
This change does fix setuptools behaviour, but now distutils no longer works. I gues someone who knows more about distutils and setuptools than I do needs to figure this one out; I originally added the non-existent nevow.athena_private package because that was the only way that seemed to work for distutils. Argh! -- mithrandi, i Ainil en-Balandor, a faer Ambar
Tristan Seligmann wrote:
* mg@divmod.net
[2006-03-09 09:12:35 -0500]: resource correctly.
Note: the actual package data is the athena_private directory in the nevow package, not the files in the non-existant nevow.athena_private package.
Modified: trunk/Nevow/setupcommon.py ============================================================================== --- trunk/Nevow/setupcommon.py (original) +++ trunk/Nevow/setupcommon.py Thu Mar 9 09:12:35 2006 @@ -17,6 +17,7 @@ 'freeform-default.css' ], 'nevow': [ + 'athena_private/*', 'athena.js', 'defer.js', 'divmod.js', @@ -48,7 +49,4 @@ 'test_object.js', 'testsupport.js', ], - 'nevow.athena_private': [ - 'connection-status-down.png', - ], }
This change does fix setuptools behaviour, but now distutils no longer works. I gues someone who knows more about distutils and setuptools than I do needs to figure this one out; I originally added the non-existent nevow.athena_private package because that was the only way that seemed to work for distutils. Argh!
Yeah, you're right. Sorry about that, although I did try it out here and it seemed ok. Obviously, I had something lurking in sys.path. Perhaps we need to make athena_private a real package? Perhaps it's a setuptools bug? It doesn't quite seem like setuptools's fault to me - why should setuptools include *package* data from something that's not a package. On the other hand, setuptools should probably copy what distutils does. Any suggestions? - Matt -- __ / \__ Matt Goodall, Pollenation Internet Ltd \__/ \ w: http://www.pollenation.net __/ \__/ e: matt@pollenation.net / \__/ \ t: +44 (0)113 2252500 \__/ \__/ / \ Any views expressed are my own and do not necessarily \__/ reflect the views of my employer.
Matt Goodall wrote:
Tristan Seligmann wrote:
* mg@divmod.net
[2006-03-09 09:12:35 -0500]: resource correctly.
Note: the actual package data is the athena_private directory in the nevow package, not the files in the non-existant nevow.athena_private package.
Modified: trunk/Nevow/setupcommon.py ============================================================================== --- trunk/Nevow/setupcommon.py (original) +++ trunk/Nevow/setupcommon.py Thu Mar 9 09:12:35 2006 @@ -17,6 +17,7 @@ 'freeform-default.css' ], 'nevow': [ + 'athena_private/*', 'athena.js', 'defer.js', 'divmod.js', @@ -48,7 +49,4 @@ 'test_object.js', 'testsupport.js', ], - 'nevow.athena_private': [ - 'connection-status-down.png', - ], }
This change does fix setuptools behaviour, but now distutils no longer works. I gues someone who knows more about distutils and setuptools than I do needs to figure this one out; I originally added the non-existent nevow.athena_private package because that was the only way that seemed to work for distutils. Argh!
Yeah, you're right. Sorry about that, although I did try it out here and it seemed ok. Obviously, I had something lurking in sys.path.
Perhaps we need to make athena_private a real package? Perhaps it's a setuptools bug?
It doesn't quite seem like setuptools's fault to me - why should setuptools include *package* data from something that's not a package. On the other hand, setuptools should probably copy what distutils does.
Any suggestions?
Actually, this seems to be a problem with the package_data to data_files stuff in setup.py to support Python 2.3. setuptools and distutils (from Python 2.4) do actually do the right thing. - Matt -- __ / \__ Matt Goodall, Pollenation Internet Ltd \__/ \ w: http://www.pollenation.net __/ \__/ e: matt@pollenation.net / \__/ \ t: +44 (0)113 2252500 \__/ \__/ / \ Any views expressed are my own and do not necessarily \__/ reflect the views of my employer.
Matt Goodall wrote:
Matt Goodall wrote:
Tristan Seligmann wrote:
[...]
This change does fix setuptools behaviour, but now distutils no longer works. I gues someone who knows more about distutils and setuptools than I do needs to figure this one out; I originally added the non-existent nevow.athena_private package because that was the only way that seemed to work for distutils. Argh!
Yeah, you're right. Sorry about that, although I did try it out here and it seemed ok. Obviously, I had something lurking in sys.path.
[...]
Actually, this seems to be a problem with the package_data to data_files stuff in setup.py to support Python 2.3.
Attached is a diff that I think should work ok with distutils (Python 2.3 and 2.4) and setuptools. Could someone else test it out please; it was a bit rushed. Thanks, Matt -- __ / \__ Matt Goodall, Pollenation Internet Ltd \__/ \ w: http://www.pollenation.net __/ \__/ e: matt@pollenation.net / \__/ \ t: +44 (0)113 2252500 \__/ \__/ / \ Any views expressed are my own and do not necessarily \__/ reflect the views of my employer. Index: setup.py =================================================================== --- setup.py (revision 5271) +++ setup.py (working copy) @@ -4,6 +4,7 @@ import os.path from distutils.command import install from distutils.core import setup +import glob import sys import setupcommon @@ -21,10 +22,12 @@ # Turn the package_data into a data_files for 2.3 compatability data_files = [] -for pkg, files in setupcommon.package_data.items(): +for pkg, patterns in setupcommon.package_data.items(): pkgdir = os.path.join(*pkg.split('.')) - files = [os.path.join(pkgdir, file) for file in files] - data_files.append([site_packages+pkgdir, files]) + for pattern in patterns: + globdir = os.path.dirname(pattern) + files = glob.glob(os.path.join(pkgdir, pattern)) + data_files.append((os.path.join(site_packages,pkgdir,globdir),files)) # We need to list the packages explicitly. packages = [
participants (2)
-
Matt Goodall
-
Tristan Seligmann