Skip to content

Commit ec72897

Browse files
authored
Merge pull request #7 from bjlittle/alpha-version
Tidy setup.py and pin to first alpha version.
2 parents 2b3f790 + 9bd85f1 commit ec72897

File tree

3 files changed

+48
-24
lines changed

3 files changed

+48
-24
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ install:
2121

2222
# Now do the things we need to do to install it.
2323
- conda create -n test_env --file requirements.txt nose python=${PYTHON} ${EXTRA_DEPS} --yes --quiet
24+
- conda list
2425
- source activate test_env
2526
- python setup.py build_ext install
2627
- mkdir not_the_source_root && cd not_the_source_root

setup.py

Lines changed: 46 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,57 @@
88
from Cython.Build import cythonize
99

1010

11-
extensions = [Extension('stratify._vinterp',
12-
['stratify/_vinterp.pyx'],
11+
NAME = 'stratify'
12+
DIR = os.path.abspath(os.path.dirname(__file__))
13+
14+
extensions = [Extension('{}._vinterp'.format(NAME),
15+
[os.path.join(NAME, '_vinterp.pyx')],
1316
include_dirs=[np.get_include()])]
1417

15-
setup(
16-
name='stratify',
17-
description='Vectorized interpolators that are especially useful for Nd vertical interpolation/stratification of atmospheric and oceanographic datasets',
18-
version='0.3.0',
18+
19+
def extract_version():
20+
version = None
21+
fname = os.path.join(DIR, NAME, '__init__.py')
22+
with open(fname) as fd:
23+
for line in fd:
24+
if (line.startswith('__version__')):
25+
_, version = line.split('=')
26+
version = version.strip()[1:-1] # Remove quotations
27+
break
28+
return version
29+
30+
31+
setup_args = dict(
32+
name=NAME,
33+
description=('Vectorized interpolators that are especially useful for '
34+
'Nd vertical interpolation/stratification of atmospheric '
35+
'and oceanographic datasets'),
36+
version=extract_version(),
1937
ext_modules=cythonize(extensions),
2038
packages=find_packages(),
2139
classifiers=[
22-
'Development Status :: 3 - Alpha',
23-
('License :: OSI Approved :: '
24-
'License :: OSI Approved :: BSD License'),
25-
'Operating System :: MacOS :: MacOS X',
26-
'Operating System :: POSIX',
27-
'Operating System :: POSIX :: AIX',
28-
'Operating System :: POSIX :: Linux',
29-
'Operating System :: Microsoft :: Windows',
30-
'Programming Language :: Python',
31-
'Programming Language :: Python :: 2',
32-
'Programming Language :: Python :: 2.7',
33-
'Programming Language :: Python :: 3',
34-
'Programming Language :: Python :: 3.4',
35-
'Programming Language :: Python :: 3.5',
36-
'Topic :: Scientific/Engineering',
37-
'Topic :: Scientific/Engineering :: GIS',
40+
'Development Status :: 3 - Alpha',
41+
('License :: OSI Approved :: '
42+
'License :: OSI Approved :: BSD License'),
43+
'Operating System :: MacOS :: MacOS X',
44+
'Operating System :: POSIX',
45+
'Operating System :: POSIX :: AIX',
46+
'Operating System :: POSIX :: Linux',
47+
'Operating System :: Microsoft :: Windows',
48+
'Programming Language :: Python',
49+
'Programming Language :: Python :: 2',
50+
'Programming Language :: Python :: 2.7',
51+
'Programming Language :: Python :: 3',
52+
'Programming Language :: Python :: 3.4',
53+
'Programming Language :: Python :: 3.5',
54+
'Topic :: Scientific/Engineering',
55+
'Topic :: Scientific/Engineering :: GIS',
3856
],
39-
extras_require={'test': ['nose'],
40-
},
57+
extras_require={'test': ['nose']},
58+
test_suite='{}.tests'.format(NAME),
4159
zip_safe=False,
4260
)
61+
62+
63+
if __name__ == '__main__':
64+
setup(**setup_args)

stratify/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
EXTRAPOLATE_LINEAR, PyFuncExtrapolator,
77
PyFuncInterpolator)
88

9+
__version__ = '0.1a0'

0 commit comments

Comments
 (0)