-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
69 lines (58 loc) · 1.78 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
"""
setup.py
"""
import os
from codecs import open
from setuptools import setup, find_packages
from setuptools.command.develop import develop
from subprocess import check_call
import shlex
from warnings import warn
here = os.path.abspath(os.path.dirname(__file__))
with open("README.rst", encoding="utf-8") as readme_file:
readme = readme_file.read()
with open(os.path.join(here, "plotting", "version.py"), encoding="utf-8") as f:
version = f.read()
version = version.split('=')[-1].strip().strip('"').strip("'")
class PostDevelopCommand(develop):
"""
Class to run post setup commands
"""
def run(self):
"""
Run method that tries to install pre-commit hooks
"""
try:
check_call(shlex.split("pre-commit install"))
except Exception as e:
warn("Unable to run 'pre-commit install': {}"
.format(e))
develop.run(self)
install_requires = ["matplotlib", "seaborn", "pandas"]
setup(
name="plotting",
version=version,
author="Michael Rossol",
author_email="[email protected]",
long_description=readme,
packages=find_packages(),
package_dir={"plotting": "plotting"},
include_package_data=True,
license="BSD license",
zip_safe=False,
keywords="rev",
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Natural Language :: English",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
],
install_requires=install_requires,
extras_require={
"dev": ["flake8", "pre-commit", "pylint"],
},
cmdclass={"develop": PostDevelopCommand},
)