diff --git a/bonobo/examples/datasets/__main__.py b/bonobo/examples/datasets/__main__.py index 8dd4c49..b5b3b4f 100644 --- a/bonobo/examples/datasets/__main__.py +++ b/bonobo/examples/datasets/__main__.py @@ -4,7 +4,7 @@ import bonobo from bonobo import examples 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.services import get_services, get_datasets_dir +from bonobo.examples.datasets.services import get_services, get_datasets_dir, get_minor_version graph_factories = { 'coffeeshops': get_coffeeshops_graph, @@ -33,7 +33,7 @@ if __name__ == '__main__': bonobo.run(graph, services=get_services()) 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 s3 = boto3.client('s3') @@ -44,7 +44,7 @@ if __name__ == '__main__': local_path = os.path.join(root, filename) relative_path = os.path.relpath(local_path, local_dir) s3_path = os.path.join( - bonobo.__version__, relative_path + get_minor_version(), relative_path ) try: diff --git a/bonobo/examples/datasets/services.py b/bonobo/examples/datasets/services.py index 9c8f2ac..6412156 100644 --- a/bonobo/examples/datasets/services.py +++ b/bonobo/examples/datasets/services.py @@ -3,10 +3,14 @@ import os import bonobo +def get_minor_version(): + return '.'.join(bonobo.__version__.split('.')[:2]) + + def get_datasets_dir(*dirs): home_dir = os.path.expanduser('~') 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) return target_dir