Distributing doc files w/ distutils src pkg?

I have a simple setup.py file: #!/usr/bin/env python from distutils.core import setup setup(name='lockfile', author='Skip Montanaro', author_email='skip <at> pobox.com', maintainer='Skip Montanaro', maintainer_email='skip <at> pobox.com', url='http://www.webfast.com/~skip/python/', download_url='http://www.webfast.com/~skip/python/lockfile.tar.gz', version='0.1', py_modules=['lockfile'], data_files=[('doc', ['lockfile.rst'])], ) I've used the data_files arg to setup to note where the docs live. Alas, the sdist command doesn't include this in the tar file: % tar tfz dist/lockfile-0.1.tar.gz lockfile-0.1/ lockfile-0.1/lockfile.py lockfile-0.1/PKG-INFO lockfile-0.1/README lockfile-0.1/setup.py I'm a complete distutils novice. I can't for the life of me understand why the doc directory isn't included in the tar file. As far as I can tell distutils has no explicit provision at all for distributing documentation, which seems very weird. What am I missing?

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Skip Montanaro wrote:
I have a simple setup.py file:
#!/usr/bin/env python
from distutils.core import setup setup(name='lockfile', author='Skip Montanaro', author_email='skip <at> pobox.com', maintainer='Skip Montanaro', maintainer_email='skip <at> pobox.com', url='http://www.webfast.com/~skip/python/', download_url='http://www.webfast.com/~skip/python/lockfile.tar.gz', version='0.1', py_modules=['lockfile'], data_files=[('doc', ['lockfile.rst'])], )
I've used the data_files arg to setup to note where the docs live. Alas, the sdist command doesn't include this in the tar file:
% tar tfz dist/lockfile-0.1.tar.gz lockfile-0.1/ lockfile-0.1/lockfile.py lockfile-0.1/PKG-INFO lockfile-0.1/README lockfile-0.1/setup.py
I'm a complete distutils novice. I can't for the life of me understand why the doc directory isn't included in the tar file. As far as I can tell distutils has no explicit provision at all for distributing documentation, which seems very weird. What am I missing?
Not a thing: you are exactly correct (I don't understand it either). Tres. - -- =================================================================== Tres Seaver +1 540-429-0999 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHJLGN+gerLs4ltQ4RAubwAKC/3EqMdGrsYZW4ylmNU43wgrocygCgxw0X 4xXPGbsC6mEP5TCJl/+W7yk= =veTk -----END PGP SIGNATURE-----

At 02:57 PM 10/28/2007 +0000, Skip Montanaro wrote:
I have a simple setup.py file:
#!/usr/bin/env python
from distutils.core import setup setup(name='lockfile', author='Skip Montanaro', author_email='skip <at> pobox.com', maintainer='Skip Montanaro', maintainer_email='skip <at> pobox.com', url='http://www.webfast.com/~skip/python/', download_url='http://www.webfast.com/~skip/python/lockfile.tar.gz', version='0.1', py_modules=['lockfile'], data_files=[('doc', ['lockfile.rst'])], )
I've used the data_files arg to setup to note where the docs live. Alas, the sdist command doesn't include this in the tar file:
% tar tfz dist/lockfile-0.1.tar.gz lockfile-0.1/ lockfile-0.1/lockfile.py lockfile-0.1/PKG-INFO lockfile-0.1/README lockfile-0.1/setup.py
I'm a complete distutils novice. I can't for the life of me understand why the doc directory isn't included in the tar file. As far as I can tell distutils has no explicit provision at all for distributing documentation, which seems very weird. What am I missing?
A MANIFEST.in file specifying what to include. Distutils requires one for docs. Note that the data_files option is for *installing* data files to e.g. /usr/share; if you're doing that you should probably have a bit more structure to what you install there than just dumping lockfile.rst in /usr/share/doc (which is what I think the above setup does). Distutils isn't very bright about putting things in an sdist unless you specify them in MANIFEST.in in some way. Setuptools is a bit smarter, in that it includes stuff under revision control (CVS, svn, or anything you've installed a file finder plugin for.)

>> What am I missing? [from my distutils setup] Phillip> A MANIFEST.in file specifying what to include. Thanks. I came up with this: include README MANIFEST lockfile.py setup.py recursive-include doc *.rst which seems to build a proper .tar.gz file. Skip
participants (4)
-
Phillip J. Eby
-
Skip Montanaro
-
skip@pobox.com
-
Tres Seaver