In my setup.py build command, I create a pickle file that I'd like to be available at runtime.
I do this by subclassing from the setuptools.command.build_py.build_py and overriding the run
command:
class my_command(build_py):
def run(self):
target_dir = os.path.join(self.build_lib, 'my_package/data')
self.mkpath(target_dir)
with open(os.path.join(target_dir, 'my_file.pkl'), 'wb') as f:
pickle.dump({'foo': 'bar'}, f)