Skip to content

setup: fix installation of data files

Javi Merino requested to merge github/fork/JaviMerino/fix_setup_py into master

include_package_data is a very nice idea but it just doesn't work. After installing trappy, importing it failed with:

import trappy Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python2.7/dist-packages/TRAPpy-1.0.0-py2.7.egg/trappy/init.py", line 20, in from trappy.plotter.LinePlot import LinePlot File "/usr/local/lib/python2.7/dist-packages/TRAPpy-1.0.0-py2.7.egg/trappy/plotter/init.py", line 23, in import trappy.plotter.EventPlot File "/usr/local/lib/python2.7/dist-packages/TRAPpy-1.0.0-py2.7.egg/trappy/plotter/EventPlot.py", line 40, in IPythonConf.iplot_install("EventPlot") File "/usr/local/lib/python2.7/dist-packages/TRAPpy-1.0.0-py2.7.egg/trappy/plotter/IPythonConf.py", line 119, in iplot_install install_resource(resource, resource_dest_path) File "/usr/local/lib/python2.7/dist-packages/TRAPpy-1.0.0-py2.7.egg/trappy/plotter/IPythonConf.py", line 94, in install_resource install_local_resource(from_path, to_path) File "/usr/local/lib/python2.7/dist-packages/TRAPpy-1.0.0-py2.7.egg/trappy/plotter/IPythonConf.py", line 77, in install_local_resource shutil.copy(from_path, to_path) File "/usr/lib/python2.7/shutil.py", line 119, in copy copyfile(src, dst) File "/usr/lib/python2.7/shutil.py", line 82, in copyfile with open(src, 'rb') as fsrc: IOError: [Errno 2] No such file or directory: '/usr/local/lib/python2.7/dist-packages/TRAPpy-1.0.0-py2.7.egg/trappy/plotter/js/EventPlot.js'

Explicitly tell setup.py which data files to install.

Merge request reports