-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
86 lines (67 loc) · 2.19 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
76
77
78
79
80
81
82
83
84
85
86
import setuptools
from distutils.core import setup
def ext_modules():
from Cython.Build import cythonize
from Cython.Distutils import Extension
from pygit2._build import get_libgit2_paths
libgit2_bin, libgit2_include, libgit2_lib = get_libgit2_paths()
ex_archive = Extension(
'paged_archive._archive',
sources=[
'./src/_archive.pyx',
'./src/gitbackend.c',
'./src/ArchiveLib/archive/Archive.c',
'./src/ArchiveLib/archive/ArchivePage.c',
'./src/ArchiveLib/archive/HashIndex.c',
'./src/ArchiveLib/archive/HashIndexPack.c'
],
cython_c_in_temp=True,
libraries=['git2', 'uuid'],
include_dirs=[libgit2_include, './src/ArchiveLib/archive'],
library_dirs=[libgit2_lib],
extra_compile_args=['-std=c11'],
)
extensions = [ex_archive, ]
return cythonize(extensions)
class lazy_cythonize(list):
def __init__(self, callback):
self._list, self.callback = None, callback
def c_list(self):
if self._list is None: self._list = self.callback()
return self._list
def __iter__(self):
for e in self.c_list(): yield e
def __getitem__(self, ii):
return self.c_list()[ii]
def __len__(self):
return len(self.c_list())
setup(
name="paged_archive",
ext_modules=lazy_cythonize(ext_modules),
dependency_links=[
'git+https://github.com/libgit2/pygit2.git@master'
],
setup_requires=[
'pygit2==0.25.0',
'Cython==0.25.2'],
install_requires=[
'pygit2==0.25.0',
'Cython==0.25.2'
],
version='0.0.dev11',
url='https://github.com/luckymarmot/GitPagedArchiveBackend',
maintainer='Matthaus Woolard',
maintainer_email="[email protected]",
author='Matthaus Woolard',
author_email='[email protected]',
packages=['paged_archive'],
license='MIT',
classifiers=[
'Development Status :: 11 - Development',
# Indicate who your project is intended for
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.6',
],
keywords='git',
)