File: setup.py

package info (click to toggle)
kitchen 1.2.4-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,044 kB
  • ctags: 1,493
  • sloc: python: 10,651; makefile: 14; sh: 4
file content (88 lines) | stat: -rwxr-xr-x 2,924 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/usr/bin/python -tt
# -*- coding: utf-8 -*-

from distutils.command.sdist import sdist as _sdist
import glob
import os
import sys

if sys.version_info[0] == 2:
    source_dir = 'kitchen2'
    packages = [
        'kitchen',
        'kitchen.versioning',
        'kitchen.i18n',
        'kitchen.iterutils',
        'kitchen.collections',
        'kitchen.text',
    ]
elif sys.version_info[0] == 3:
    source_dir = 'kitchen3'
    packages = [
        'kitchen',
        'kitchen.versioning',
        'kitchen.i18n',
        'kitchen.iterutils',
        'kitchen.collections',
        'kitchen.text',
    ]
else:
    raise NotImplementedError("Python version unsupported %r" % sys.version)

sys.path.append(os.path.abspath(source_dir))

# Now that we have modified sys.path, these imports will pull in either the py3
# version or the py2 version.
import kitchen.release

import releaseutils

from setuptools import setup

# Override sdist command to compile the message catalogs as well
class Sdist(_sdist, object):
    def run(self):
        releaseutils.main()
        data_files = []
        for langfile in filter(os.path.isfile, glob.glob('locale/*/*/*.mo')):
            data_files.append((os.path.dirname(langfile), [langfile]))
        if self.distribution.data_files and \
                hasattr(self.distribution.data_files, 'extend'):
            self.distribution.data_files.extend(data_files)
        else:
            self.distribution.data_files = data_files
        super(Sdist, self).run()


setup(name='kitchen',
      version=str(kitchen.release.__version__),
      description=kitchen.release.DESCRIPTION,
      long_description=kitchen.release.LONG_DESCRIPTION,
      author=kitchen.release.AUTHOR,
      author_email=kitchen.release.EMAIL,
      maintainer='Toshio Kuratomi',
      maintainer_email='toshio@fedoraproject.org',
      license=kitchen.release.LICENSE,
      url=kitchen.release.URL,
      cmdclass={'sdist': Sdist},
      keywords='Useful Small Code Snippets',
      classifiers=[
            'Development Status :: 4 - Beta',
            'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)',
            'Operating System :: OS Independent',
            'Programming Language :: Python :: 2',
            'Programming Language :: Python :: 2.4',
            'Programming Language :: Python :: 2.5',
            'Programming Language :: Python :: 2.6',
            'Programming Language :: Python :: 2.7',
            'Programming Language :: Python :: 3',
            'Programming Language :: Python :: 3.3',
            'Programming Language :: Python :: 3.4',
            'Topic :: Software Development :: Internationalization',
            'Topic :: Software Development :: Libraries :: Python Modules',
            'Topic :: Text Processing :: General',
          ],
      packages=packages,
      package_dir={'' : source_dir},
      data_files=[],
)