-
Notifications
You must be signed in to change notification settings - Fork 19
/
setup.py
53 lines (45 loc) · 1.51 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
import os
import configparser
from setuptools import setup
from setuptools.command.install import install
from setuptools.command.develop import develop
def create_config():
local_dir = os.path.expanduser("~")
config = configparser.ConfigParser()
config.add_section("local_settings")
_dir = input("Enter directory (abs path) to store for sqlite db:")
config.set("local_settings", "sqlite_dir", _dir)
with open(os.path.join(local_dir, ".nemweb_config.ini"), "w") as cfgfile:
config.write(cfgfile)
class PostInstallCommand(install):
"""Post-installation for install mode."""
def run(self):
try:
create_config()
except:
pass
install.run(self)
class PostDevelopCommand(develop):
"""Post-installation for development mode."""
def run(self):
try:
create_config()
except:
pass
develop.run(self)
setup(name='nemweb',
version='0.1',
description="newweb file handler",
long_description="python package to directly download and process AEMO files from http://www.nemweb.com.au/ and inserts tables into a local sqlite database.",
author='dylan',
author_email='[email protected]',
license='MIT',
packages=['nemweb'],
zip_safe=False,
install_requires=[
'pandas',
'requests'],
cmdclass={'install': PostInstallCommand,
'develop': PostDevelopCommand},
package_data={'nemweb': 'tests/2018_09_21.pkl'}
)