forked from APrioriInvestments/typed_python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
96 lines (87 loc) · 2.66 KB
/
setup.py
File metadata and controls
96 lines (87 loc) · 2.66 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
# Copyright 2018 Braxton Mckee
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import setuptools
import pkg_resources
from distutils.command.build_ext import build_ext
from distutils.extension import Extension
class NumpyBuildExtension(build_ext):
"""
Used for when numpy headers are needed during build.
Ensures that numpy will be installed before attempting
to include any of its libraries
"""
def run(self):
self.include_dirs.append(
pkg_resources.resource_filename('numpy', 'core/include'))
build_ext.run(self)
extra_compile_args = [
'-O2',
'-fstack-protector-strong',
'-Wformat',
'-Wdate-time',
'-Werror=format-security',
'-std=c++14',
'-Wno-sign-compare',
'-Wno-narrowing',
'-Wno-unused-variable'
]
ext_modules = [
Extension(
'object_database._types',
sources=[
'object_database/all.cpp',
],
define_macros=[
("_FORTIFY_SOURCE", 2)
],
extra_compile_args=extra_compile_args
),
Extension(
'typed_python._types',
sources=[
'typed_python/all.cpp',
],
define_macros=[
("_FORTIFY_SOURCE", 2)
],
extra_compile_args=extra_compile_args
)
]
INSTALL_REQUIRES = [line.strip() for line in open('requirements.txt')]
setuptools.setup(
name='nativepython',
version='0.0.1',
description='Tools for generating machine code using python.',
author='Braxton Mckee',
author_email='braxton.mckee@gmail.com',
url='https://github.com/braxtonmckee/nativepython',
packages=setuptools.find_packages(),
cmdclass={'build_ext': NumpyBuildExtension},
ext_modules=ext_modules,
setup_requires=[
'numpy'
],
install_requires=INSTALL_REQUIRES,
classifiers=[
"Programming Language :: Python :: 3"
],
entry_points={
'console_scripts': [
'object_database_webtest=object_database.frontends.object_database_webtest:main',
'object_database_service_manager=object_database.frontends.service_manager:main',
]
},
include_package_data=True,
zip_safe=False
)