forked from Unidata/siphon
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
77 lines (66 loc) · 2.85 KB
/
Copy pathsetup.py
File metadata and controls
77 lines (66 loc) · 2.85 KB
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
from __future__ import print_function
from setuptools import setup, find_packages, Command
import versioneer
class MakeExamples(Command):
description = 'Create example scripts from IPython notebooks'
user_options=[]
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import glob
import os
import os.path
from nbconvert.exporters import python
from traitlets.config import Config
examples_dir = os.path.join(os.path.dirname(__file__), 'examples')
script_dir = os.path.join(examples_dir, 'scripts')
if not os.path.exists(script_dir):
os.makedirs(script_dir)
c = Config({'Exporter': {'template_file': 'examples/python-scripts.tpl'}})
exporter = python.PythonExporter(config=c)
for fname in glob.glob(os.path.join(examples_dir, 'notebooks', '*.ipynb')):
output, _ = exporter.from_filename(fname)
out_fname = os.path.splitext(os.path.basename(fname))[0]
out_name = os.path.join(script_dir, out_fname + '.py')
print(fname, '->', out_name)
with open(out_name, 'w') as outf:
outf.write(output)
ver = versioneer.get_version()
commands = versioneer.get_cmdclass()
commands.update(examples=MakeExamples)
setup(
name = "siphon",
version = ver,
packages = find_packages(),
cmdclass=commands,
author = "Unidata Development Team",
author_email = 'support-python@unidata.ucar.edu',
license = 'MIT',
url = "https://github.com/Unidata/siphon",
test_suite = "nose.collector",
description = ("A collection of Python utilities for interacting with the "
"Unidata technology stack."),
keywords='meteorology weather',
classifiers=['Development Status :: 2 - Pre-Alpha',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Topic :: Scientific/Engineering',
'Intended Audience :: Science/Research',
'Operating System :: OS Independent',
'License :: OSI Approved :: MIT License'],
install_requires=['numpy>=1.8', 'protobuf>=3.0.0a3', 'requests>=1.2'],
extras_require={
'netcdf': 'netCDF4>=1.1.0',
'dev': 'ipython[all]>=3.1',
'test': ['nose', 'netCDF4>=1.1.0',
'vcrpy~=1.5,!=1.7.0,!=1.7.1,!=1.7.2,!=1.7.3'],
'doc': ['sphinx>=1.3', 'nbconvert>=4.0', 'IPython>=4.0'],
'examples': 'matplotlib>=1.3'
},
download_url='https://github.com/Unidata/siphon/archive/v%s.tar.gz' % ver,)