-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.py
75 lines (64 loc) · 2.64 KB
/
setup.py
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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
from setuptools import setup
from setuptools.extension import Extension
from sys import platform
buildCython = '--cython' in sys.argv
if platform == "darwin":
extensions = [
Extension(
name = 'indexed_zstd',
sources = [ 'indexed_zstd/indexed_zstd.pyx' ] if buildCython
else [ 'indexed_zstd/indexed_zstd.cpp' ],
include_dirs = [ '.' ],
language = 'c++',
extra_compile_args = [ '-std=c++11', '-O3', '-DNDEBUG' ],
libraries = ['m', 'zstd'],
),
]
zstd_seek = ('zstd_zeek', {
'sources': ['indexed_zstd/libzstd-seek/zstd-seek.c']
})
else:
extensions = [
Extension(
name = 'indexed_zstd',
sources = [ 'indexed_zstd/indexed_zstd.pyx', 'indexed_zstd/libzstd-seek/zstd-seek.c' ] if buildCython
else [ 'indexed_zstd/indexed_zstd.cpp', 'indexed_zstd/libzstd-seek/zstd-seek.c' ],
include_dirs = [ '.' ],
language = 'c++',
extra_compile_args = [ '-std=c++11', '-O3', '-DNDEBUG' ],
libraries = ['m', 'zstd'],
),
]
zstd_seek = ('zstd_zeek', {
'sources': ['indexed_zstd/libzstd-seek/zstd-seek.c']
})
if buildCython:
from Cython.Build import cythonize
extensions = cythonize( extensions, compiler_directives = { 'language_level' : '3' } )
del sys.argv[sys.argv.index( '--cython' )]
scriptPath = os.path.abspath( os.path.dirname( __file__ ) )
with open( os.path.join( scriptPath, 'README.md' ), encoding = 'utf-8' ) as file:
readmeContents = file.read()
setup(
name = 'indexed_zstd',
version = '1.3.1',
description = 'Fast random access to zstd files',
url = 'https://github.com/martinellimarco/indexed_zstd',
author = 'Martinelli Marco with help of Maximilian Knespel',
license = 'MIT',
classifiers = [ 'License :: OSI Approved :: MIT License',
'Development Status :: 4 - Beta',
'Operating System :: POSIX',
'Operating System :: Unix',
'Programming Language :: Python :: 3',
'Topic :: System :: Archiving' ],
long_description = readmeContents,
long_description_content_type = 'text/markdown',
py_modules = [ 'indexed_zstd' ],
libraries = [ zstd_seek ] if platform == "darwin" else [],
ext_modules = extensions
)