[issue6205] sdist doesn't include data_files

James report at bugs.python.org
Fri Jun 5 16:03:27 CEST 2009


New submission from James <purpleidea at gmail.com>:

Hi, I have shown the output from my terminal below, since it will be
easier to follow for explaining the bug.

james at computer:~/testsetup$ ls
helloworld2.py  image1.jpg  setup.py
james at 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 at gmail.com',
	py_modules=py_modules,
	# data_files: install directory, 
	data_files=[('share/helloworld2', ['image1.jpg'])]
)

james at 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 at 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

----------
assignee: tarek
components: Distutils
messages: 88945
nosy: purpleidea, tarek
severity: normal
status: open
title: sdist doesn't include data_files
type: behavior
versions: Python 2.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6205>
_______________________________________


More information about the Python-bugs-list mailing list