forked from Unidata/cftime
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
38 lines (30 loc) · 1.1 KB
/
Copy pathsetup.py
File metadata and controls
38 lines (30 loc) · 1.1 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
import os
from setuptools import Extension, setup
rootpath = os.path.abspath(os.path.dirname(__file__))
def extract_version(module='cftime'):
version = None
fname = os.path.join(rootpath, module, '_cftime.pyx')
with open(fname) as f:
for line in f:
if (line.startswith('__version__')):
_, version = line.split('=')
version = version.strip()[1:-1] # Remove quotation characters.
break
return version
with open('requirements.txt') as f:
reqs = f.readlines()
install_requires = [req.strip() for req in reqs]
with open('requirements-dev.txt') as f:
reqs = f.readlines()
tests_require = [req.strip() for req in reqs]
setup(
name='cftime',
author='Jeff Whitaker',
author_email='jeffrey.s.whitaker@noaa.gov',
description='Time-handling functionality from netcdf4-python',
packages=['cftime'],
version=extract_version(),
ext_modules=[Extension('cftime._cftime', sources=['cftime/_cftime.pyx'])],
setup_requires=install_requires,
install_requires=install_requires,
tests_require=tests_require)