Title: sdist doesn't include data_files
Type: behavior Stage:
Components: Distutils Versions: Python 2.5
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: tarek Nosy List: purpleidea, tarek
Priority: normal Keywords:

Created on 2009-06-05 14:03 by purpleidea, last changed 2009-06-15 13:39 by purpleidea. This issue is now closed.

Messages (3)
msg88945 - (view) Author: James (purpleidea) Date: 2009-06-05 14:03
Hi, I have shown the output from my terminal below, since it will be
easier to follow for explaining the bug.

james@computer:~/testsetup$ ls  image1.jpg
james@computer:~/testsetup$ cat 
import distutils.core	#from distutils.core import setup, Extension
import os

# build a list of modules required for setup function below
py_modules = []


	description='distutils test',
	# data_files: install directory, 
	data_files=[('share/helloworld2', ['image1.jpg'])]

james@computer:~/testsetup$ ./ sdist
running sdist
warning: sdist: manifest template '' does not exist (using
default file list)
warning: sdist: standard file not found: should have one of README,
writing manifest file 'MANIFEST'
creating helloworld2-0.1
making hard links in helloworld2-0.1...
hard linking -> helloworld2-0.1
hard linking -> helloworld2-0.1
creating dist
tar -cf dist/helloworld2-0.1.tar helloworld2-0.1
gzip -f9 dist/helloworld2-0.1.tar
removing 'helloworld2-0.1' (and everything under it)

as you will notice, the image1.jpg file does not get included in the
source distribution, and if i want to backup the entire dir/code of
everything to send to someone else.
perhaps this is a peculiarity of distutils. i realize i could write my
own but then i have to specify *everything* and this isn't
automatic anymore.
this is definitely an issue since a user who downloads the sdist file
and runs an install will see:

error: can't copy 'image1.jpg': doesn't exist or not a regular file

this occurs because it obviously didn't get included in the sdist. the
same thing happens when sdist is run with --no-prune

i thought that perhaps i was using the wrong target so i tried a bdist
(tar.gz). in this case the image1.jpg file gets included, however
unpacking the directory doesn't give me a structure similar to the one
my code is originally maintained in.
so how do i use distutils to share *everything*, (eg: everything
specified in the directory) with my friends on the tubes?

if you want, i'll write a patch.

msg89347 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2009-06-14 12:11
Hi James, this has been changed already for trunk and 3.x, see #2279.

Although it hasn't been backported in Python 2.6.x because it's a major
behavior change that breaks setuptools.

Although, when 2.7 and 3.2 are out, we will provide a backport of
distutils. for 2.6 and 2.5.

until then you do have to declare your files in the template
msg89402 - (view) Author: James (purpleidea) Date: 2009-06-15 13:39
great, thanks for the info.
Date User Action Args
2009-06-15 13:39:48purpleideasetmessages: + msg89402
2009-06-14 12:11:41tareksetstatus: open -> closed
resolution: wont fix
messages: + msg89347
2009-06-05 14:03:24purpleideacreate