<div dir="ltr">Hello,<div>I am trying to install a module with a package and also an examples directory. How do I get my examples installed on users' machines into a reasonable location, in a cross-platform kind of way?</div><div><br></div><div> I notice that a number of Python examples are installed in /usr/share (in Linux) or in <home>\AppData\Local\Programs\Python\Python36\Share on Windows 8.</div><div><br></div><div>So in my setup.py, I have this:</div><div><br></div>from setuptools import setup, find_packages<br>from codecs import open<br>from os import path<br><br>with open(path.join('.', 'README.md'), encoding='utf-8') as f:<br> long_description = f.read()<br><br>setup(<br> name='kivydnd',<br> version='0.5.0',<br> description='Kivy Drag-n-Drop for Widgets',<br> long_description=long_description,<br> long_description_content_type='text/markdown',<br> url='<a href="https://github.com/GreyGnome/KivyDnD">https://github.com/GreyGnome/KivyDnD</a>',<br> author='GreyGnome',<br> author_email='<a href="mailto:myemail@example.com">myemail@example.com</a>',<br> license='Apache License 2.0',<br> keywords='kivy drag-n-drop',<br> packages=find_packages(exclude=[]),<br> data_files=[('share/kivydnd-examples', ['examples/dndexample1.py',])],<br>)<br><br>But when I try to install them on Linux, I don't see the dndexample1.py file anywhere:<br><br>python setup.py sdist<br>pip install --target=/home/schwager/lib/python dist/kivydnd-0.5.0.tar.gz --log /tmp/piplog<br><br>(Note that I am using a different target for testing).<br><br>The piplog shows that it at least tried to do something with the examples, but I can find a directory by that name anywhere in my home directory:<br><br><snippet from log><br> creating /tmp/tmpirrDx8/share/kivydnd-examples<br> copying examples/dndexample1.py -> /tmp/tmpirrDx8/share/kivydnd-examples<div><span style="font-family:monospace"><br></span></div><div><div>Thanks!</div>-- <br><div class="gmail_signature">-Mike Schwager</div>
</div></div>