- Notifications
You must be signed in to change notification settings - Fork68
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·119 lines (105 loc) · 4.42 KB
/
setup.py
File metadata and controls
executable file
·119 lines (105 loc) · 4.42 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#!/usr/bin/env python
fromdistutils.coreimportsetup,Extension
fromdistutils.command.build_pyimportbuild_py
fromdistutils.command.build_extimportbuild_ext
importos,sys
# wow, this is a mixed bag ... I am pretty upset about all of this ...
setuptools_build_py_module=None
try:
# don't pull it in if we don't have to
if'setuptools'insys.modules:
importsetuptools.command.build_pyassetuptools_build_py_module
fromsetuptools.command.build_extimportbuild_ext
exceptImportError:
pass
classbuild_ext_nofail(build_ext):
"""Doesn't fail when build our optional extensions"""
defrun(self):
try:
build_ext.run(self)
exceptException:
print("Ignored failure when building extensions, pure python modules will be used instead")
# END ignore errors
defget_data_files(self):
"""Can you feel the pain ? So, in python2.5 and python2.4 coming with maya,
the line dealing with the ``plen`` has a bug which causes it to truncate too much.
It is fixed in the system interpreters as they receive patches, and shows how
bad it is if something doesn't have proper unittests.
The code here is a plain copy of the python2.6 version which works for all.
Generate list of '(package,src_dir,build_dir,filenames)' tuples"""
data= []
ifnotself.packages:
returndata
# this one is just for the setup tools ! They don't iniitlialize this variable
# when they should, but do it on demand using this method.Its crazy
ifhasattr(self,'analyze_manifest'):
self.analyze_manifest()
# END handle setuptools ...
forpackageinself.packages:
# Locate package source directory
src_dir=self.get_package_dir(package)
# Compute package build directory
build_dir=os.path.join(*([self.build_lib]+package.split('.')))
# Length of path to strip from found files
plen=0
ifsrc_dir:
plen=len(src_dir)+1
# Strip directory from globbed filenames
filenames= [
file[plen:]forfileinself.find_data_files(package,src_dir)
]
data.append((package,src_dir,build_dir,filenames))
returndata
build_py.get_data_files=get_data_files
ifsetuptools_build_py_module:
setuptools_build_py_module.build_py._get_data_files=get_data_files
# END apply setuptools patch too
# NOTE: This is currently duplicated from the gitdb.__init__ module, as we cannot
# satisfy the dependencies at installation time, unfortunately, due to inherent limitations
# of distutils, which cannot install the prerequesites of a package before the acutal package.
__author__="Sebastian Thiel"
__contact__="byronimo@gmail.com"
__homepage__="https://github.com/gitpython-developers/gitdb"
version_info= (0,6,0)
__version__='.'.join(str(i)foriinversion_info)
setup(cmdclass={'build_ext':build_ext_nofail},
name="gitdb",
version=__version__,
description="Git Object Database",
author=__author__,
author_email=__contact__,
url=__homepage__,
packages= ('gitdb','gitdb.db','gitdb.utils'),
package_dir= {'gitdb':'gitdb'},
ext_modules=[Extension('gitdb._perf', ['gitdb/_fun.c','gitdb/_delta_apply.c'],include_dirs=['gitdb'])],
license="BSD License",
zip_safe=False,
requires=('smmap (>=0.8.3)', ),
install_requires=('smmap >= 0.8.3'),
long_description="""GitDB is a pure-Python git object database""",
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
# Picked from
# http://pypi.python.org/pypi?:action=list_classifiers
#"Development Status :: 1 - Planning",
#"Development Status :: 2 - Pre-Alpha",
#"Development Status :: 3 - Alpha",
# "Development Status :: 4 - Beta",
"Development Status :: 5 - Production/Stable",
#"Development Status :: 6 - Mature",
#"Development Status :: 7 - Inactive",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Operating System :: POSIX",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS :: MacOS X",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
],)