The data_files parameter for setup takes input in the following format:
data_files = [(target_directory, [list of files to be put there])]
I don't know how to do that with relative paths
You need to get the path of the directory first, so...
Say you have this directory structure:
cur_directory |- setup.py |- inner_dir |- file2.py
To get the directory of the current file (in this case setup.py), use this:
cur_directory_path = os.path.abspath(os.path.dirname(__file__))
Then, to get a directory path relative to
current_directory, just join some other directories, eg:
inner_dir_path = os.path.join(cur_directory_path, 'inner_dir')
If you want to move up a directory, just use "
..", for example:
parent_dir_path = os.path.join(current_directory, '..')
Once you have that path, you can do
If you want the path of a file, in this case "
file2.py" relative to
setup.py, you could do:
file2_path = os.path.join(cur_directory_path, 'inner_dir', 'file2.py')