distutils question-> Why data_files listed in setup.py being ignored?! How fix?

  • Thread starter Christian Seberino
  • Start date
C

Christian Seberino

I have a setup.py with something like this:


import glob

....

setup( ...,
...,
data_files = [ ( "pixmaps", glob.glob("pixmaps/*.xpm") ) ]
....
)

The tarball I made with "python setup.py sdist" looks good except
none of the data_files show up in tarball?!?!

How fix?

Chris
 
D

David M. Cooke

At said:
I have a setup.py with something like this:

import glob

...

setup( ...,
...,
data_files = [ ( "pixmaps", glob.glob("pixmaps/*.xpm") ) ]
....
)

The tarball I made with "python setup.py sdist" looks good except
none of the data_files show up in tarball?!?!

How fix?

You have to add them to your MANIFEST.in . Something like:
include pixmaps/*.xpm

setup(scripts=...) has the same problem.
 
C

Christian Seberino

David

Thank you *very* much. I needed that.

Chris

[email protected] (David M. Cooke) wrote in message news: said:
At said:
I have a setup.py with something like this:

import glob

...

setup( ...,
...,
data_files = [ ( "pixmaps", glob.glob("pixmaps/*.xpm") ) ]
....
)

The tarball I made with "python setup.py sdist" looks good except
none of the data_files show up in tarball?!?!

How fix?

You have to add them to your MANIFEST.in . Something like:
include pixmaps/*.xpm

setup(scripts=...) has the same problem.
 
C

Christian Seberino

David

I'm sorry but I'm still having problems.
I added an include line in MANIFEST.in
but still cannot get *any* data files included!!

I made a toy example to show my problem...

=============================================
Here are my package files:
=============================================
setup.py
MANIFEST.in
foo.py
somedata
=============================================
Here is contents of setup.py:
=============================================
from distutils.core import setup

setup(name = "foo",
version = "1.0",
data_files = [ ("data", ["somedata"]) ],
packages = [""])
=============================================
Here is MANIFEST.in:
=============================================
include "somedata"
=============================================
Here is what happens when I try to do "python setup.py sdist":
=============================================
% python setup.py sdist
running sdist
....etc.
reading manifest template 'MANIFEST.in'
warning: no files found matching '"somedata"'
....etc.
=============================================

I tried *absolute* paths in MANIFEST.in and data_files.
I tried to move data files to different places. I tried using wild
cards.

NOTHING seems to make distutils SEE my data files?!?!?

Chris
 
T

Terje Rosten

* Christian Seberino
|
| Here is MANIFEST.in:
| =============================================
| include "somedata"

Try:

include somedata


- Terje
 
C

Christian Seberino

Terje

Thanks. All is well now. Does it seem strange to you that you must
specify data files in setup.py with data_files field and then
AGAIN in the MANIFEST.in file with include???

How make MANIFEST.in NOT be necessary for data files?

Chris
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top