-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathsetup.py
224 lines (205 loc) · 7.86 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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
#!/usr/bin/env python3
# Part of TotalDepth: Petrophysical data processing and presentation
# Copyright (C) 2011-2021 Paul Ross
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Paul Ross: apaulross@gmail.com
"""The setup script.
copyright 2010-2020, Paul Ross
"""
import os
import sysconfig
from setuptools import Extension, setup, find_packages
COPYRIGHT = '2010-2020, Paul Ross'
# from Cython.Build import cythonize
# Mac OS:
# MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++ python setup.py develop
# Obtain TotalDepth.ENTRY_POINTS_CONSOLE_SCRIPTS as we can't import TotalDepth
with open(os.path.join('src', 'TotalDepth', '__init__.py')) as init_file:
code = compile(init_file.read(), __file__, 'exec')
exec(code)
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
install_requirements = [
'Cython',
'Pillow',
'beautifulsoup4',
'colorama',
'lxml',
'numpy',
'psutil',
'requests',
]
setup_requirements = [
'setuptools>=18.0',
'Cython',
'wheel',
'pytest-runner',
]
test_requirements = [
'pytest',
'asv',
]
XML_FORMAT_FILES = [
'src/TotalDepth/util/plot/formats/Azimuthal_Density_3Track.xml',
'src/TotalDepth/util/plot/formats/Azimuthal_Density_Image.xml',
'src/TotalDepth/util/plot/formats/Azimuthal_Resistivity_3Track.xml',
'src/TotalDepth/util/plot/formats/Blank_3Track_Depth.xml',
'src/TotalDepth/util/plot/formats/Blank_3Track_Time.xml',
'src/TotalDepth/util/plot/formats/Formation_Micro_Image_Aligned.xml',
'src/TotalDepth/util/plot/formats/Formation_Micro_Image_Processed.xml',
'src/TotalDepth/util/plot/formats/Formation_Test_Time.xml',
'src/TotalDepth/util/plot/formats/HDT.xml',
'src/TotalDepth/util/plot/formats/Micro_Resistivity_3Track.xml',
'src/TotalDepth/util/plot/formats/Natural_GR_Spectrometry_3Track.xml',
'src/TotalDepth/util/plot/formats/OilBaseMicroImager_Equalized.xml',
'src/TotalDepth/util/plot/formats/Porosity_GR_3Track.xml',
'src/TotalDepth/util/plot/formats/Pulsed_Neutron_3Track.xml',
'src/TotalDepth/util/plot/formats/Pulsed_Neutron_Time.xml',
'src/TotalDepth/util/plot/formats/Resistivity_3Track_Correlation.xml',
'src/TotalDepth/util/plot/formats/Resistivity_3Track_Logrithmic.xml',
'src/TotalDepth/util/plot/formats/Resistivity_Porosity_GR_3Track.xml',
'src/TotalDepth/util/plot/formats/Resistivity_Radial_Investigation_Image.xml',
'src/TotalDepth/util/plot/formats/Resistivity_at_the_Bit.xml',
'src/TotalDepth/util/plot/formats/Resistivity_at_the_bit_deep_image.xml',
'src/TotalDepth/util/plot/formats/Resistivity_at_the_bit_medium_image.xml',
'src/TotalDepth/util/plot/formats/Resistivity_at_the_bit_shallow_image.xml',
'src/TotalDepth/util/plot/formats/Sonic_3Track.xml',
'src/TotalDepth/util/plot/formats/Sonic_LowerDipole_VDL.xml',
'src/TotalDepth/util/plot/formats/Sonic_P_S_VDL.xml',
'src/TotalDepth/util/plot/formats/Sonic_Stonely_VDL.xml',
'src/TotalDepth/util/plot/formats/Sonic_UpperDipole_VDL.xml',
'src/TotalDepth/util/plot/formats/Sonic_Waveform4_Depth.xml',
]
XML_FORMAT_FILES = [os.path.join(*p.split('/')) for p in XML_FORMAT_FILES]
data_files = [
# XML Format files
(
os.path.join('TotalDepth', 'util', 'plot', 'formats'),
XML_FORMAT_FILES
),
# Example data
(
os.path.join('TotalDepth', 'example_data', 'BIT', 'data'),
(
os.path.join('example_data', 'BIT', 'data', '29_10-_3Z_dwl_DWL_WIRE_1644659.bit'),
),
),
(
os.path.join('TotalDepth', 'example_data', 'LAS', 'data'),
(
os.path.join('example_data', 'LAS', 'data', '1000079714.las'),
os.path.join('example_data', 'LAS', 'data', '206_05a-_3_DWL_DWL_WIRE_258276498_0_2000T.las'),
os.path.join('example_data', 'LAS', 'data', 'BASIC_FILE_0_50.las'),
),
),
(
os.path.join('TotalDepth', 'example_data', 'LIS', 'data'),
(
os.path.join('example_data', 'LIS', 'data', 'DILLSON-1_WELL_LOGS_FILE-013.LIS'),
os.path.join('example_data', 'LIS', 'data', 'DILLSON-1_WELL_LOGS_FILE-037.LIS'),
os.path.join('example_data', 'LIS', 'data', 'DILLSON-1_WELL_LOGS_FILE-049.LIS'),
),
),
(
os.path.join('TotalDepth', 'example_data', 'RP66V1', 'data'),
(
os.path.join('example_data', 'RP66V1', 'data', '206_05a-_3_DWL_DWL_WIRE_258276498.DLIS'),
os.path.join('example_data', 'RP66V1', 'data', 'BASIC_FILE.dlis'),
os.path.join('example_data', 'RP66V1', 'data', 'BASIC_FILE_WITH_TWO_VISIBLE_RECORDS_NO_IFLRS.dlis'),
os.path.join('example_data', 'RP66V1', 'data', 'MINIMAL_FILE.dlis'),
),
),
# Static units data
(
os.path.join('TotalDepth', 'common', 'data',),
(
os.path.join('src', 'TotalDepth', 'common', 'data', 'osdd_units.json'),
),
),
]
# ext_modules = cythonize(
# module_list="src/TotalDepth/LIS/core/*.pyx",
# )
extra_compile_args = []
cflags = sysconfig.get_config_var('CFLAGS')
if cflags != None:
extra_compile_args = sysconfig.get_config_var('CFLAGS').split()
ext_modules = [
Extension(
"TotalDepth.LIS.core.cRepCode",
sources=[
"src/TotalDepth/LIS/core/src/cython/cRepCode.pyx",
]
),
Extension(
"TotalDepth.LIS.core.cFrameSet",
sources=[
"src/TotalDepth/LIS/core/src/cython/cFrameSet.pyx",
]
),
Extension(
"TotalDepth.LIS.core.cpRepCode",
sources=[
"src/TotalDepth/LIS/core/src/cp/cpLISRepCode.cpp",
"src/TotalDepth/LIS/core/src/cpp/LISRepCode.cpp",
],
extra_compile_args=extra_compile_args + [
"-Isrc/TotalDepth/LIS/core/src/cp",
"-Isrc/TotalDepth/LIS/core/src/cpp",
'-std=c++14',
],
),
]
setup(
name='TotalDepth',
version='0.4.0',
description="TotalDepth is a software collection that can process petrophysical data such as wireline logs.",
long_description=readme + '\n\n' + history,
long_description_content_type='text/x-rst',
author="Paul Ross",
author_email='apaulross@gmail.com',
url='https://github.com/paulross/TotalDepth',
packages=find_packages('src'),
package_dir={'' : 'src'},
# package_data={'' : ['TotalDepth/util/plot/formats/*.xml']},
data_files=data_files,
entry_points={
'console_scripts': ENTRY_POINTS_CONSOLE_SCRIPTS,
},
include_package_data=True,
license="GPLv2",
zip_safe=False,
keywords='TotalDepth',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
],
test_suite='tests',
setup_requires=setup_requirements,
install_requires=install_requirements,
tests_require=test_requirements,
# cmdclass = {'build_ext': build_ext},
ext_modules=ext_modules
)