From 8353c5ebfb5c7da9cf46a4fbe80074b88ab9ef6e Mon Sep 17 00:00:00 2001 From: Yannik Stradmann Date: Wed, 19 Jun 2019 23:46:27 +0200 Subject: [PATCH] Add demo for nested/flat python file installation --- demos/python/nested_scripts/bar/nested_bar.py | 3 +++ demos/python/nested_scripts/foo/nested_foo.py | 3 +++ demos/python/wscript | 18 ++++++++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 demos/python/nested_scripts/bar/nested_bar.py create mode 100644 demos/python/nested_scripts/foo/nested_foo.py diff --git a/demos/python/nested_scripts/bar/nested_bar.py b/demos/python/nested_scripts/bar/nested_bar.py new file mode 100644 index 00000000..f74f2b5a --- /dev/null +++ b/demos/python/nested_scripts/bar/nested_bar.py @@ -0,0 +1,3 @@ +""" +Nested file in bar/ +""" diff --git a/demos/python/nested_scripts/foo/nested_foo.py b/demos/python/nested_scripts/foo/nested_foo.py new file mode 100644 index 00000000..ba64dcb6 --- /dev/null +++ b/demos/python/nested_scripts/foo/nested_foo.py @@ -0,0 +1,3 @@ +""" +Nested file in foo/ +""" diff --git a/demos/python/wscript b/demos/python/wscript index 07b5b666..07b071d5 100644 --- a/demos/python/wscript +++ b/demos/python/wscript @@ -50,3 +50,21 @@ def build(bld): source = 'test.c', target = 'test') + # Install files keeping their directory structure (default: relative_trick=True) + # + # This will create two files: + # * lib/python2.7/site-packages/nested_scripts/bar/nested_bar.py + # * lib/python2.7/site-packages/nested_scripts/foo/nested_foo.py + bld(features='py', + source=bld.path.ant_glob('nested_scripts/**/*.py'), + install_from='.') + + # Install files flatting the directory structure (relative_trick=False) + # + # This will create two files: + # * lib/python2.7/site-packages/nested_bar.py + # * lib/python2.7/site-packages/nested_foo.py + bld(features='py', + source=bld.path.ant_glob('nested_scripts/**/*.py'), + relative_trick=False, + install_from='.')