easy_install doesn't install non-package *.py file

M

Makoto Kuwata

I got trouble about easy_install command.

My package:

README.rst
setup.py
foobar/
foobar/__init__.py
foobar/data/
foobar/data/template.py

In the above example, 'foobar/data/template.py' is just a
template data file (= not a python module file).
(notice that 'foobar/data/__init__.py' doesn't exist.)

In this case, 'foobar/data/template.py' file is NOT installed
when trying 'easy_install foobar'.
This is trouble what I got.

I found that:

* foobar.tar.gz created by 'easy_install sdist' contains
'foobar/data/template.py' correctly.
* foobar.egg created by 'easy_install bdist' doesn't contain
'foobar/data/template.py' file.

Question: how can I enforce easy_install command to
install 'foobar/data/template.py' (or non-package *.py file)?
 
J

Jonathan Hartley

Hey. I don't know the details, but your setup.py needs to use either the 'package_data' or the 'data_files' entry in the dict you pass to setup. Thesecan specify files you want included in the sdist which aren't package files.

There are many complications with using them though. One of them in particular (I don't remember which one) installs the files you specify in a different place depending on whether the user is installing the sdist from local files (python setup.py install) or using pip, so be sure to test both ways.
 
J

Jonathan Hartley

Hey. I don't know the details, but your setup.py needs to use either the 'package_data' or the 'data_files' entry in the dict you pass to setup. Thesecan specify files you want included in the sdist which aren't package files.

There are many complications with using them though. One of them in particular (I don't remember which one) installs the files you specify in a different place depending on whether the user is installing the sdist from local files (python setup.py install) or using pip, so be sure to test both ways.
 
M

Makoto Kuwata

Hey. I don't know the details, but your setup.py needs to use either the 'package_data' or the 'data_files' entry in the dict you pass to setup. These can specify files you want included in the sdist which aren't package files.

There are many complications with using them though. One of them in particular (I don't remember which one) installs the files you specify in a different place depending on whether the user is installing the sdist from local files (python setup.py install) or using pip, so be sure to test both ways.

'package_data' is the solution for my trouble.
Thank you very much, Jonathan.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top