fixes #36 database copy bug

This commit is contained in:
Jan Laukemann
2019-10-04 00:40:23 +02:00
parent 5f42253824
commit 953c51f7be
3 changed files with 8 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
include README.rst
include LICENSE
include tox.ini
recursive-include osaca/data/ *.csv
recursive-include osaca/data/ *.yml
include examples/*
recursive-include tests *.py *.out
recursive-include tests/testfiles/ *

View File

@@ -17,7 +17,8 @@ from osaca.semantics import (KernelDG, MachineModel, SemanticsAppender,
MODULE_DATA_DIR = os.path.join(
os.path.dirname(os.path.split(os.path.abspath(__file__))[0]), 'osaca/data/'
)
DATA_DIR = os.path.expanduser('~') + '/.osaca/data/'
LOCAL_OSACA_DIR = os.path.join(os.path.expanduser('~') + '/.osaca/')
DATA_DIR = os.path.join(LOCAL_OSACA_DIR, 'data/')
# Stolen from pip
@@ -122,7 +123,9 @@ def check_user_dir():
# Check if data files are already in usr dir, otherwise create them
if not os.path.isdir(DATA_DIR):
os.makedirs(DATA_DIR)
call(['cp', '-r', MODULE_DATA_DIR, DATA_DIR])
for f in os.listdir(MODULE_DATA_DIR):
if not os.path.exists(os.path.join(DATA_DIR, f)):
call(['cp', '-r', os.path.join(MODULE_DATA_DIR, f), DATA_DIR])
else:
# Compare and warn if files in DATA_DIR are different
dir_comp = dircmp(DATA_DIR, MODULE_DATA_DIR)

View File

@@ -75,6 +75,7 @@ setup(
# that you indicate wheter you support Python2, Python 3 or both.
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
],
# What doesd your project relate to?
@@ -91,9 +92,8 @@ setup(
install_requires=[
'kerncraft',
'networkx',
'numpy',
'pyparsing',
'pygraphviz'
'pygraphviz',
],
python_requires='>=3.5',