Changeset 3170 for trac/plugins/tracnav


Ignore:
Timestamp:
03/02/07 16:19:34 (6 years ago)
Author:
moschny
Message:

Setuptools bug: the 'sdist' command doesn't honor 'package_data', thus
creating an incomplete source distribution.

The workaround is to add the contents of 'package_data' to the file
list before calling the original make_distribution method.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trac/plugins/tracnav/setup.py

    r3142 r3170  
    11#!/usr/bin/python 
    22 
     3from tracnav import __version__ as VERSION 
    34from setuptools import setup 
    4 from tracnav import __version__ as VERSION 
     5 
     6# workaround for a setuptools bug: sdist doesn't honor package_data 
     7from setuptools.command.sdist import sdist as _sdist 
     8import glob, os 
     9 
     10class mysdist(_sdist): 
     11 
     12    def make_distribution(self): 
     13        # add the package_data files to self.filelist 
     14        for key, globs in self.distribution.package_data.iteritems():  
     15            for pattern in globs: 
     16                self.filelist.extend(glob.glob(os.path.join(key, pattern))) 
     17        _sdist.make_distribution(self) 
     18 
    519 
    620setup( 
     
    1428    maintainer_email = 'moschny@ipd.uni-karlsruhe.de', 
    1529    url = 'http://svn.ipd.uka.de/trac/javaparty/wiki/TracNav', 
    16     description = 'The navigation bar for Trac', 
     30    description = 'The Navigation Bar for Trac', 
    1731    entry_points={'trac.plugins': ['TracNav = tracnav.tracnav']}, 
    1832    keywords = 'trac toc', 
    1933    license = 'GPL', 
     34    cmdclass = { 'sdist' : mysdist } 
    2035) 
Note: See TracChangeset for help on using the changeset viewer.