Example datasets are now stored by bonobo minor version.
This commit is contained in:
@ -4,7 +4,7 @@ import bonobo
|
|||||||
from bonobo import examples
|
from bonobo import examples
|
||||||
from bonobo.examples.datasets.coffeeshops import get_graph as get_coffeeshops_graph
|
from bonobo.examples.datasets.coffeeshops import get_graph as get_coffeeshops_graph
|
||||||
from bonobo.examples.datasets.fablabs import get_graph as get_fablabs_graph
|
from bonobo.examples.datasets.fablabs import get_graph as get_fablabs_graph
|
||||||
from bonobo.examples.datasets.services import get_services, get_datasets_dir
|
from bonobo.examples.datasets.services import get_services, get_datasets_dir, get_minor_version
|
||||||
|
|
||||||
graph_factories = {
|
graph_factories = {
|
||||||
'coffeeshops': get_coffeeshops_graph,
|
'coffeeshops': get_coffeeshops_graph,
|
||||||
@ -33,7 +33,7 @@ if __name__ == '__main__':
|
|||||||
bonobo.run(graph, services=get_services())
|
bonobo.run(graph, services=get_services())
|
||||||
|
|
||||||
if options['sync']:
|
if options['sync']:
|
||||||
# XXX/TODO: when parallel option for node will be implemented, need to be rewriten to use a graph.
|
# TODO: when parallel option for node will be implemented, need to be rewriten to use a graph.
|
||||||
import boto3
|
import boto3
|
||||||
|
|
||||||
s3 = boto3.client('s3')
|
s3 = boto3.client('s3')
|
||||||
@ -44,7 +44,7 @@ if __name__ == '__main__':
|
|||||||
local_path = os.path.join(root, filename)
|
local_path = os.path.join(root, filename)
|
||||||
relative_path = os.path.relpath(local_path, local_dir)
|
relative_path = os.path.relpath(local_path, local_dir)
|
||||||
s3_path = os.path.join(
|
s3_path = os.path.join(
|
||||||
bonobo.__version__, relative_path
|
get_minor_version(), relative_path
|
||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
@ -3,10 +3,14 @@ import os
|
|||||||
import bonobo
|
import bonobo
|
||||||
|
|
||||||
|
|
||||||
|
def get_minor_version():
|
||||||
|
return '.'.join(bonobo.__version__.split('.')[:2])
|
||||||
|
|
||||||
|
|
||||||
def get_datasets_dir(*dirs):
|
def get_datasets_dir(*dirs):
|
||||||
home_dir = os.path.expanduser('~')
|
home_dir = os.path.expanduser('~')
|
||||||
target_dir = os.path.join(
|
target_dir = os.path.join(
|
||||||
home_dir, '.cache/bonobo', bonobo.__version__, *dirs
|
home_dir, '.cache/bonobo', get_minor_version(), *dirs
|
||||||
)
|
)
|
||||||
os.makedirs(target_dir, exist_ok=True)
|
os.makedirs(target_dir, exist_ok=True)
|
||||||
return target_dir
|
return target_dir
|
||||||
|
|||||||
Reference in New Issue
Block a user