-
Notifications
You must be signed in to change notification settings - Fork 40
/
setup.py
143 lines (125 loc) · 5.81 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
"""Chemical Engineering Design Library (ChEDL). Utilities for process modeling.
Copyright (C) 2016, 2017, 2018, 2019, 2020 Caleb Bell
<Caleb.Andrew.Bell@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
from setuptools import setup
from wheel.bdist_wheel import bdist_wheel
import os
import shutil
from pathlib import Path
import tempfile
class bdist_wheel_light(bdist_wheel):
description = "Build a light wheel package without large data files"
def run(self):
pkg_dir = Path(os.path.abspath('chemicals'))
# Files to exclude (relative to chemicals directory)
exclude_files = [
'Law',
'Environment/Syrres logP data.csv.gz',
'Identifiers/dippr_2014.csv',
'Misc/ChemSep8.32.xml',
'Identifiers/chemical identifiers pubchem large.tsv',
'Identifiers/chemical identifiers pubchem small.tsv',
'Identifiers/chemical identifiers example user db.tsv',
]
# Create temporary directory
with tempfile.TemporaryDirectory() as temp_dir:
moved_files = []
try:
# Move files to temporary location
for rel_path in exclude_files:
orig_path = pkg_dir / rel_path
if orig_path.exists():
# Create path in temp dir maintaining structure
temp_path = Path(temp_dir) / rel_path
temp_path.parent.mkdir(parents=True, exist_ok=True)
if orig_path.is_dir():
shutil.move(str(orig_path), str(temp_path))
else:
shutil.move(str(orig_path), str(temp_path))
moved_files.append((orig_path, temp_path))
# Build the wheel
super().run()
finally:
# Restore moved files
for orig_path, temp_path in moved_files:
if temp_path.exists():
orig_path.parent.mkdir(parents=True, exist_ok=True)
shutil.move(str(temp_path), str(orig_path))
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: Education',
'Intended Audience :: Manufacturing',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Operating System :: MacOS',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Operating System :: POSIX :: BSD',
'Operating System :: POSIX :: Linux',
'Operating System :: Unix',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Education',
'Topic :: Scientific/Engineering :: Atmospheric Science',
'Topic :: Scientific/Engineering :: Chemistry',
'Topic :: Scientific/Engineering :: Physics',
]
setup(
name = 'chemicals',
packages = ['chemicals'],
license='MIT',
version = '1.3.2',
description = 'Chemical properties component of Chemical Engineering Design Library (ChEDL)',
author = 'Caleb Bell',
install_requires=['fluids>=1.1.0', "scipy>=1.6.0", 'numpy', 'pandas'],
extras_require = {
'Coverage documentation': ['wsgiref>=0.1.2', 'coverage>=4.0.3']
},
long_description=open('README.rst').read(),
platforms=["Windows", "Linux", "Mac OS", "Unix"],
author_email = 'Caleb.Andrew.Bell@gmail.com',
url = 'https://github.com/CalebBell/chemicals',
download_url = 'https://github.com/CalebBell/chemicals/tarball/1.3.2',
keywords = ['chemical engineering', 'chemistry', 'mechanical engineering',
'thermodynamics', 'databases', 'cheminformatics', 'engineering','viscosity',
'density', 'heat capacity', 'thermal conductivity', 'surface tension',
'combustion', 'environmental engineering', 'solubility', 'vapor pressure',
'equation of state', 'molecule'],
classifiers = classifiers,
package_data={'chemicals': ['Critical Properties/*', 'Density/*',
'Electrolytes/*', 'Environment/*', 'Heat Capacity/*', 'Identifiers/*',
'Law/*', 'Misc/*', 'Phase Change/*', 'Reactions/*', 'Safety/*',
'Solubility/*', 'Interface/*', 'Triple Properties/*',
'Thermal Conductivity/*',
'Vapor Pressure/*', 'Viscosity/*']},
cmdclass={
'bdist_wheel_light': bdist_wheel_light,
}
)