forked from abilian/olapy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
58 lines (50 loc) · 1.91 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
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import os
import zipfile
from os.path import expanduser
from shutil import copyfile
from pip.download import PipSession
from pip.req import parse_requirements
from setuptools import find_packages, setup
RUNNING_TOX = 'RUNNING_TOX' in os.environ
session = PipSession()
_install_requires = parse_requirements('requirements.txt', session=session)
install_requires = [str(ir.req) for ir in _install_requires]
setup(
name='olapy',
version="0.4.0",
packages=find_packages(),
author="Abilian SAS",
author_email="[email protected]",
description="OLAP Engine",
url='https://github.com/abilian/olapy',
# TODO fix tox problem with path
long_description=open('README.rst').read(),
install_requires=install_requires,
include_package_data=False,
# cmdclass={
# 'develop': PostDevelopCommand,
# 'install': PostInstallCommand,
# },
classifiers=[
"Programming Language :: Python",
'Development Status :: 3 - Alpha',
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2.7",
# "Topic :: Business intelligence",
],)
if 'OLAPY_PATH' in os.environ:
home_directory = os.environ['OLAPY_PATH']
elif RUNNING_TOX:
home_directory = os.environ.get('HOME_DIR')
else:
home_directory = expanduser("~")
if not os.path.isdir(os.path.join(home_directory, 'olapy-data', 'cubes')):
os.makedirs(os.path.join(home_directory, 'olapy-data', 'cubes'))
zip_ref = zipfile.ZipFile('cubes_templates/cubes_temp.zip', 'r')
zip_ref.extractall(os.path.join(home_directory, 'olapy-data', 'cubes'))
zip_ref.close()
if not os.path.isfile(os.path.join(home_directory, 'olapy-data','olapy-config.xml')):
copyfile('config/olapy-config.xml', os.path.join(home_directory, 'olapy-data','olapy-config.xml'))