-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathsetup.py
71 lines (56 loc) · 1.9 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
import os
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = ["--verbose"]
self.test_suite = True
def run_tests(self):
import pytest
errno = pytest.main(self.test_args)
sys.exit(errno)
def extract_version():
version = None
fdir = os.path.dirname(__file__)
fnme = os.path.join(fdir, "yaml2ncml", "__init__.py")
with open(fnme) as fd:
for line in fd:
if line.startswith("__version__"):
_, version = line.split("=")
version = version.strip()[1:-1]
break
return version
rootpath = os.path.abspath(os.path.dirname(__file__))
def read(*parts):
return open(os.path.join(rootpath, *parts)).read()
long_description = "{}\n{}".format(read("README.rst"), read("CHANGES.txt"))
LICENSE = read("LICENSE.txt")
with open("requirements.txt") as f:
require = f.readlines()
install_requires = [r.strip() for r in require]
setup(
name="yaml2ncml",
version=extract_version(),
packages=["yaml2ncml"],
license=LICENSE,
description="ncML aggregation from YAML specifications",
long_description=long_description,
author="Rich Signell",
author_email="[email protected]",
install_requires=install_requires,
entry_points=dict(console_scripts=["yaml2ncml = yaml2ncml.yaml2ncml:main"]),
url="https://github.com/rsignell-usgs/yaml2ncml",
keywords=["YAML", "ncml"],
classifiers=[
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"License :: OSI Approved :: MIT License",
],
tests_require=["pytest"],
cmdclass=dict(test=PyTest),
zip_safe=False,
)