-
-
Notifications
You must be signed in to change notification settings - Fork 32
/
setup.py
128 lines (117 loc) · 3.33 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
"""
The different setup versions method is shamelessly copied from mikedh's trimesh
Python library - thank you!
"""
import os
import sys
from setuptools import setup, find_packages
# load __version__ without importing anything
version_file = os.path.join(
os.path.dirname(__file__),
'welleng/version.py')
with open(version_file, 'r') as f:
# use eval to get a clean string of version from file
__version__ = eval(f.read().strip().split('=')[-1])
with open("README.md", "r") as f:
long_description = f.read()
# with open("requirements.txt") as f:
# required = f.read().splitlines()
download_url = f'https://github.com/jonnymaserati/welleng/archive/v{__version__}.tar.gz'
# If you only want to generate surveys and errors, these are all that's
# required
requirements_default = set([
'numpy',
'scipy',
'openpyxl',
'pandas',
'pint',
'pyproj', # required for getting survey parameters
'PyYAML',
'setuptools',
'vedo',
'vtk'
])
# these can be installed without compiling required
requirements_easy = set([
'magnetic_field_calculator', # used to get default mag data for survey
'networkx',
'tabulate',
'trimesh',
'utm'
])
# this is the troublesome requirement that needs C dependencies
requirements_all = requirements_easy.union([
'python-fcl',
])
# if someone wants to output a requirements file
# `python setup.py --list-all > requirements.txt`
if '--list-all' in sys.argv:
# will not include default requirements (numpy)
print('\n'.join(requirements_all))
exit()
elif '--list-easy' in sys.argv:
# again will not include numpy+setuptools
print('\n'.join(requirements_easy))
exit()
# if sys.platform == 'win32':
# requirements_all.append('python-fcl-win32')
# else:
# requirements_all.append('python-fcl')
setup(
name='welleng',
version=__version__,
description='A collection of Well Engineering tools',
long_description=long_description,
long_description_content_type="text/markdown",
url='https://github.com/jonnymaserati/welleng',
download_url=download_url,
keywords=[
'well',
'trajectory',
'wellpath',
'wellbore',
'drilling',
'drill',
'error',
'separation',
'minimum curvature',
'iscwsa',
'owsg',
'well engineering',
'wells',
'drilling engineering',
'directional drilling',
'mwd',
'survey',
'covariance',
'digitalization',
'automation',
'volve',
'witsml',
],
author='Jonathan Corcutt',
author_email='jonnycorcutt@gmail.com',
license='Apache 2.0',
classifiers=[
'Development Status :: 4 - Beta',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Natural Language :: English',
'Topic :: Scientific/Engineering',
],
# python_requires='>=3.9',
packages=find_packages(exclude=["tests"]),
package_data={
'welleng': [
'errors/*.yaml',
'errors/tool_codes/*.yaml',
'exchange/*.yaml'
]
},
install_requires=list(requirements_default),
extras_require={
'easy': list(requirements_easy),
'all': list(requirements_all)
}
)