-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
111 lines (106 loc) · 3.26 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
# coding=utf-8
import sys
from setuptools import setup
from flopyparser import __version__, __name__, __author__
if sys.version_info[0] != 3 or sys.version_info[1] < 4:
print("""
This script requires Python version 3.4.
It contains with statements for file handles.
And it contains TemporaryDirectory from tempfile,
which was in introduced in 3.2
""")
sys.exit(1)
setup(
name=__name__,
description=
'Converts MODFLOW input files to a Python Flopy script',
# long_description=long_description,
version=__version__,
packages=['flopyparser'],
license='MIT',
author=__author__,
author_email='[email protected]',
url='https://github.com/bdestombe/python-flopy-parser',
download_url='https://github.com/bdestombe/python-flopy-parser/archive/' +
__version__ + '.tar.gz',
keywords=['flopy', 'groundwater', 'hydrology'],
install_requires=[
'numpy>=1.12', 'nbformat>=4.3', 'nbconvert>=5.1', 'flopy>=3.2', 'yapf'
],
platforms='Windows, Mac OS-X',
classifiers=[
"Development Status :: 4 - Beta",
"Topic :: Scientific/Engineering",
"Programming Language :: Python :: 3 :: Only",
"License :: OSI Approved :: BSD License",
"Natural Language :: English",
"License :: OSI Approved :: MIT License",
],
entry_points={
"console_scripts":
['flopyparser = flopyparser.flopyparser:main']
})
# try:
# import pypandoc
#
# long_description = pypandoc.convert('README.md', 'rst')
# long_description = long_description.replace("\r", "")
#
# except OSError as e:
# import io
# # pandoc is not installed, fallback to using raw contents
# with io.open('README.md', encoding="utf-8") as f:
# long_description = f.read()
#
# try:
# from flopyparser.model import Model
# import io
# import nbformat
# import zipfile
# import nbconvert
# import flopy
#
# p_list = list(flopy.seawat.Seawat().mfnam_packages.keys())
#
# mp = Model(add_pack=p_list)
#
# # with description
# nb = mp.script_model2nb(use_yapf=False)
# ipynb_buff = io.StringIO(nbformat.writes(nb))
# s = nbconvert.export(nbconvert.get_exporter('markdown'), ipynb_buff)[0]
#
# s = s.replace('\n\n```', '\n\n```python')
#
# p_list_order = list(mp.packages.keys())
# toc = [
# '* [' + i + '](#' + i.replace('.', '') + ')\n' for i in p_list_order
# ]
# toc = ''.join(toc)
#
# with open('wiki_default_parameters.md', 'w') as f:
# f.write(toc)
# f.write(s)
#
# ipynb_buff.close()
#
# # without discription
# nb = mp.script_model2nb(print_descr=False, use_yapf=False)
# ipynb_buff = io.StringIO(nbformat.writes(nb))
# s = nbconvert.export(nbconvert.get_exporter('markdown'), ipynb_buff)[0]
#
# s = s.replace('\n\n```', '\n\n```python')
#
# p_list_order = list(mp.packages.keys())
# toc = [
# '* [' + i + '](#' + i.replace('.', '') + ')\n' for i in p_list_order
# ]
# toc = ''.join(toc)
#
# with open('wiki_default_parameters_without_description.md', 'w') as f:
# f.write(toc)
# f.write(s)
#
# ipynb_buff.close()
#
# except OSError as e:
# print('unable to update wiki_default_parameters.md')