source: trac/plugins/tracnav/setup.py

Last change on this file was 3170, checked in by moschny, 9 years ago

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.

  • Property svn:executable set to *
File size: 1.1 KB
Line 
1#!/usr/bin/python
2
3from tracnav import __version__ as VERSION
4from setuptools import setup
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
19
20setup(
21    name = 'TracNav',
22    version = VERSION,
23    packages = ['tracnav'],
24    package_data = { 'tracnav': ['htdocs/css/*.css'] },
25    author = 'Bernhard Haumacher',
26    author_email = 'haui@haumacher.de',
27    maintainer = 'Thomas Moschny',
28    maintainer_email = 'moschny@ipd.uni-karlsruhe.de',
29    url = 'http://svn.ipd.uka.de/trac/javaparty/wiki/TracNav',
30    description = 'The Navigation Bar for Trac',
31    entry_points={'trac.plugins': ['TracNav = tracnav.tracnav']},
32    keywords = 'trac toc',
33    license = 'GPL',
34    cmdclass = { 'sdist' : mysdist }
35)
Note: See TracBrowser for help on using the repository browser.