-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
188 lines (132 loc) · 4.8 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
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
#!/usr/bin/env python
#
# Copyright (c) 2020 Fernando Pelliccioni
#
import glob
import os
import platform
import shutil
import stat
import sys
from setuptools import setup, find_packages
from setuptools.extension import Extension
from distutils import dir_util, file_util
from distutils import log
from setuptools.command.install_lib import install_lib
from setuptools.command.install import install
from setuptools.command.develop import develop
# from setuptools.command.egg_info import egg_info
from setuptools.command.build_ext import build_ext
from distutils.command.build import build
from setuptools.command.install import install
from setuptools.dist import Distribution
import fnmatch
from sys import platform
PKG_NAME = 'aserti3416cpp'
SYSTEM = sys.platform
def get_similar_lib(path, pattern):
# for file in os.listdir('.'):
# if fnmatch.fnmatch(file, '*.txt'):
# print file
for file in os.listdir(path):
if fnmatch.fnmatch(file, pattern):
return file
return ""
def get_libraries():
return []
def do_build_stuff():
print('*********************************************************************************************************')
print(os.path.dirname(os.path.abspath(__file__)))
print(os.getcwd())
print('*********************************************************************************************************')
prev_dir = os.getcwd()
print('*********************************************************************************************************')
print(os.path.dirname(os.path.abspath(__file__)))
print(os.getcwd())
print('*********************************************************************************************************')
os.chdir(prev_dir)
print('*********************************************************************************************************')
print(os.path.dirname(os.path.abspath(__file__)))
print(os.getcwd())
print('*********************************************************************************************************')
extensions[0].libraries = get_libraries()
class DevelopCommand(develop):
user_options = develop.user_options
def initialize_options(self):
develop.initialize_options(self)
def finalize_options(self):
develop.finalize_options(self)
def run(self):
do_build_stuff()
develop.run(self)
class InstallCommand(install):
user_options = install.user_options
def initialize_options(self):
install.initialize_options(self)
def finalize_options(self):
install.finalize_options(self)
def run(self):
do_build_stuff()
install.run(self)
class BuildCommand(build):
user_options = build.user_options
def initialize_options(self):
build.initialize_options(self)
def finalize_options(self):
build.finalize_options(self)
def run(self):
do_build_stuff()
build.run(self)
# ------------------------------------------------
extensions = [
Extension('aserti3416cpp',
# define_macros = [('KTH_LIB_STATIC', None),],
# include_dirs=['kth/include'],
# library_dirs=['kth/lib'],
sources = ['aserti3-416.cpp', 'aserti3-416_capi.cpp', 'aserti3-416_pyapi.c', 'pyapi_module.c'],
),
]
exec(open('./version.py').read())
setup(
name = PKG_NAME,
version = __version__,
description = 'ASERT i3 416 C++ wrapper',
long_description = 'ASERT i3 416 C++ wrapper',
url='https://github.com/fpelliccioni',
author='Fernando Pelliccioni',
author_email='fpelliccioni@gmail.com',
license='MIT',
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
# How mature is this project? Common values are
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Topic :: Software Development :: Build Tools',
'License :: OSI Approved :: MIT License',
'Programming Language :: C++',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
],
keywords='bitcoin cash difficulty daa asert',
setup_requires=["wheel"],
extras_require={
'dev': ['check-manifest'],
'test': ['coverage'],
},
ext_modules = extensions,
cmdclass={
'build': BuildCommand,
'install': InstallCommand,
'develop': DevelopCommand,
# 'egg_info': EggInfoCommand,
},
)