[Distutils] How to install examples files?
Michael Schwager
mschwage at gmail.com
Tue Apr 10 17:08:39 EDT 2018
It looks like the following setup.py will do what I want, but it won't
install the examples when I use --target:
from setuptools import setup, find_packages
from codecs import open
from os import path
with open(path.join('.', 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='kivydnd',
version='0.5.0',
description='Kivy Drag-n-Drop for Widgets',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/GreyGnome/KivyDnD',
author='GreyGnome',
author_email='mschwage at gmail.com',
license='Apache License 2.0',
keywords='kivy drag-n-drop',
packages=find_packages(exclude=[]),
data_files=[('share/kivydnd-examples',
[
'examples/dndexample1.py',
'examples/dndexample2.py',
'examples/dndexample3.py',
'examples/dndexample_copy_draggable.py',
'examples/dndexample_drop_groups.py',
'examples/dndexample_relative_layout.py',
'examples/example_base_classes.py',
'examples/example_base_classes.pyc',
]
)],
)
On Sat, Apr 7, 2018 at 12:48 AM, Michael Schwager <mschwage at gmail.com>
wrote:
> Hello,
> 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?
>
> 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.
>
> So in my setup.py, I have this:
>
> from setuptools import setup, find_packages
> from codecs import open
> from os import path
>
> with open(path.join('.', 'README.md'), encoding='utf-8') as f:
> long_description = f.read()
>
> setup(
> name='kivydnd',
> version='0.5.0',
> description='Kivy Drag-n-Drop for Widgets',
> long_description=long_description,
> long_description_content_type='text/markdown',
> url='https://github.com/GreyGnome/KivyDnD',
> author='GreyGnome',
> author_email='myemail at example.com',
> license='Apache License 2.0',
> keywords='kivy drag-n-drop',
> packages=find_packages(exclude=[]),
> data_files=[('share/kivydnd-examples', ['examples/dndexample1.py',])],
> )
>
> But when I try to install them on Linux, I don't see the dndexample1.py
> file anywhere:
>
> python setup.py sdist
> pip install --target=/home/schwager/lib/python dist/kivydnd-0.5.0.tar.gz
> --log /tmp/piplog
>
> (Note that I am using a different target for testing).
>
> 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:
>
> <snippet from log>
> creating /tmp/tmpirrDx8/share/kivydnd-examples
> copying examples/dndexample1.py -> /tmp/tmpirrDx8/share/kivydnd-
> examples
>
> Thanks!
> --
> -Mike Schwager
>
--
-Mike Schwager
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20180410/b6f844e0/attachment.html>
More information about the Distutils-SIG
mailing list