Commit 18470cf9 authored by mouadh's avatar mouadh

update-deps

parent 1a74ee32
......@@ -11,6 +11,45 @@ from setuptools import find_packages, setup
RUNNING_TOX = 'RUNNING_TOX' in os.environ
from setuptools.command.install import install
# class PostDevelopCommand(develop):
# """Post-installation for development mode."""
# def run(self):
# # PUT YOUR PRE-INSTALL SCRIPT HERE or CALL A FUNCTION
# print('111111111111111111111111')
# develop.run(self)
#
# basedir = expanduser('~')
# if not os.path.isfile(os.path.join(basedir, 'olapy-data', 'olapy.db')):
# # try:
# from manage import initdb
# initdb()
# # PUT YOUR POST-INSTALL SCRIPT HERE or CALL A FUNCTION
class PostInstallCommand(install):
"""Post-installation for installation mode."""
def run(self):
# PUT YOUR PRE-INSTALL SCRIPT HERE or CALL A FUNCTION
install.run(self)
# initiate cubes examples
if 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')):
try:
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()
except:
raise Exception('unable to create cubes directory !')
session = PipSession()
_install_requires = parse_requirements('requirements.txt', session=session)
install_requires = [str(ir.req) for ir in _install_requires]
......@@ -27,6 +66,10 @@ setup(
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',
......@@ -39,17 +82,4 @@ setup(
# # generate and set secret key
# os.environ["SECRET_KEY"]
# initiate cubes examples
if 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')):
try:
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()
except:
raise Exception('unable to create cubes directory !')
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment