This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: sdist doesn't include data_files
Type: behavior Stage:
Components: Distutils Versions: Python 2.5
process
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 2022-04-11 14:56 by admin. 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
helloworld2.py  image1.jpg  setup.py
james@computer:~/testsetup$ cat setup.py 
#!/usr/bin/python
import distutils.core	#from distutils.core import setup, Extension
import os

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

py_modules.append('helloworld2')

distutils.core.setup(
	name='helloworld2',
	description='distutils test',
	version='0.1',
	author='James',
	author_email='purpleidea@gmail.com',
	py_modules=py_modules,
	# data_files: install directory, 
	data_files=[('share/helloworld2', ['image1.jpg'])]
)

james@computer:~/testsetup$ ./setup.py sdist
running sdist
warning: sdist: manifest template 'MANIFEST.in' does not exist (using
default file list)
warning: sdist: standard file not found: should have one of README,
README.txt
writing manifest file 'MANIFEST'
creating helloworld2-0.1
making hard links in helloworld2-0.1...
hard linking helloworld2.py -> helloworld2-0.1
hard linking setup.py -> 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)
james@computer:~/testsetup$ 

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 manifest.in 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 setup.py directory) with my friends on the tubes?

if you want, i'll write a patch.

_J
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 MANIFEST.in template
msg89402 - (view) Author: James (purpleidea) Date: 2009-06-15 13:39
great, thanks for the info.
History
Date User Action Args
2022-04-11 14:56:49adminsetgithub: 50454
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