forked from nilmtk/nilmtk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
128 lines (111 loc) · 3.59 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
"""
Copyright 2013-2020 NILMTK developers
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
from setuptools import setup, find_packages, Extension
from os.path import join
import os
import sys
import warnings
# import numpy
TRAVIS_TAG = os.environ.get("TRAVIS_TAG", "")
if TRAVIS_TAG:
# TODO: validate if the tag is a valid version number
VERSION = TRAVIS_TAG
ISRELEASED = not ("dev" in TRAVIS_TAG)
QUALIFIER = ""
else:
MAJOR = 0
MINOR = 4
MICRO = 0
DEV = 1 # For multiple dev pre-releases, please increment this value
ISRELEASED = False
VERSION = "%d.%d.%d" % (MAJOR, MINOR, MICRO)
QUALIFIER = ""
FULLVERSION = VERSION
if not ISRELEASED and not TRAVIS_TAG:
try:
import subprocess
try:
pipe = subprocess.Popen(
["git", "rev-parse", "--short", "HEAD"], stdout=subprocess.PIPE
).stdout
except OSError:
# msysgit compatibility
pipe = subprocess.Popen(
["git.cmd", "rev-parse", "--short", "HEAD"], stdout=subprocess.PIPE
).stdout
rev = pipe.read().strip()
# makes distutils blow up on Python 2.7
if sys.version_info[0] >= 3:
rev = rev.decode("ascii")
# Use a local version tag to include the git revision
FULLVERSION += ".dev{}+git.{}".format(DEV, rev)
except:
FULLVERSION += ".dev{}".format(DEV)
warnings.warn(
'WARNING: Could not get the git revision, version will be "{}"'.format(
FULLVERSION
)
)
else:
FULLVERSION += QUALIFIER
def write_version_py(filename=None):
cnt = """\
version = '%s'
short_version = '%s'
"""
if not filename:
filename = os.path.join(os.path.dirname(__file__), "nilmtk", "version.py")
a = open(filename, "w", encoding="utf-8")
try:
a.write(cnt % (FULLVERSION, VERSION))
finally:
a.close()
write_version_py()
# End of Version Check
setup(
name="nilmtk",
version=FULLVERSION,
packages=find_packages(),
package_data={"": ["*.yaml"]},
install_requires=[
"future",
"six",
"psycopg2-binary",
"pandas==0.25.3",
"networkx==2.1",
"scipy",
"tables",
"scikit-learn>=0.21.2",
"hmmlearn>=0.2.1",
"pyyaml",
"matplotlib==3.1.3",
"jupyter",
],
description="Estimate the energy consumed by individual appliances from "
"whole-house power meter readings",
author="NILMTK developers",
author_email="",
url="https://github.com/nilmtk/nilmtk",
download_url="https://github.com/nilmtk/nilmtk/tarball/master#egg=nilmtk-dev",
long_description=open("README.md", encoding="utf-8").read(),
license="Apache 2.0",
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache 2.0",
"Programming Language :: Python",
"Topic :: Scientific/Engineering :: Mathematics",
],
keywords="smartmeters power electricity energy analytics redd "
"disaggregation nilm nialm",
)