~ubuntu-branches/ubuntu/wily/attic/wily

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Package Import Robot
  • Author(s): Clint Adams
  • Date: 2013-11-25 09:06:12 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20131125090612-hp1yitu1qnpbuaq7
Tags: 0.8.1-1
* New upstream version.
* Bump to Standards-Version 3.9.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
from glob import glob
5
5
import attic
6
6
 
 
7
import versioneer
 
8
versioneer.versionfile_source = 'attic/_version.py'
 
9
versioneer.versionfile_build = 'attic/_version.py'
 
10
versioneer.tag_prefix = ''
 
11
versioneer.parentdir_prefix = 'Attic-' # dirname like 'myproject-1.2.0'
 
12
 
 
13
 
7
14
min_python = (3, 2)
8
15
if sys.version_info < min_python:
9
16
    print("Attic requires Python %d.%d or later" % min_python)
13
20
    from setuptools import setup, Extension
14
21
except ImportError:
15
22
    from distutils.core import setup, Extension
16
 
from distutils.command.sdist import sdist
17
23
 
18
24
chunker_source = 'attic/chunker.pyx'
19
25
hashindex_source = 'attic/hashindex.pyx'
22
28
    from Cython.Distutils import build_ext
23
29
    import Cython.Compiler.Main as cython_compiler
24
30
 
25
 
    class Sdist(sdist):
 
31
    class Sdist(versioneer.cmd_sdist):
26
32
        def __init__(self, *args, **kwargs):
27
33
            for src in glob('attic/*.pyx'):
28
34
                cython_compiler.compile(glob('attic/*.pyx'),
29
35
                                        cython_compiler.default_options)
30
 
            sdist.__init__(self, *args, **kwargs)
 
36
            versioneer.cmd_sdist.__init__(self, *args, **kwargs)
31
37
 
32
38
        def make_distribution(self):
33
39
            self.filelist.extend(['attic/chunker.c', 'attic/_chunker.c', 'attic/hashindex.c', 'attic/_hashindex.c'])
34
40
            super(Sdist, self).make_distribution()
35
41
 
36
42
except ImportError:
37
 
    class Sdist(sdist):
 
43
    class Sdist(versioneer.cmd_sdist):
38
44
        def __init__(self, *args, **kwargs):
39
45
            raise Exception('Cython is required to run sdist')
40
46
 
47
53
with open('README.rst', 'r') as fd:
48
54
    long_description = fd.read()
49
55
 
 
56
cmdclass = versioneer.get_cmdclass()
 
57
cmdclass.update({'build_ext': build_ext, 'sdist': Sdist})
 
58
 
50
59
setup(
51
60
    name='Attic',
52
 
    version=attic.__release__,
 
61
    version=versioneer.get_version(),
53
62
    author='Jonas Borgström',
54
63
    author_email='jonas@borgstrom.se',
55
64
    url='https://pythonhosted.org/Attic/',
71
80
    ],
72
81
    packages=['attic', 'attic.testsuite'],
73
82
    scripts=['scripts/attic'],
74
 
    cmdclass={'build_ext': build_ext, 'sdist': Sdist},
 
83
    cmdclass=cmdclass,
75
84
    ext_modules=[
76
85
        Extension('attic.chunker', [chunker_source]),
77
86
        Extension('attic.hashindex', [hashindex_source])