summaryrefslogtreecommitdiff
path: root/distutils/command/sdist.py
blob: 0b0c49d4b0c2e67ad8942e3ceeab52d3b9d9ea71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

from distutils.command.sdist import *
from distutils.command.sdist import sdist as old_sdist
from scipy.distutils.misc_util import get_data_files

class sdist(old_sdist):

    def add_defaults (self):
        old_sdist.add_defaults(self)

        if self.distribution.has_data_files():
            for data in self.distribution.data_files:
                self.filelist.extend(get_data_files(data))

        if self.distribution.has_headers():
            headers = []
            for h in self.distribution.headers:
                if isinstance(h,str): headers.append(h)
                else: headers.append(h[1])
            self.filelist.extend(headers)

        return