distutils, sdist and tests

Steven Bethard steven.bethard at gmail.com
Sat Jan 27 19:25:28 CET 2007


How do I get distutils to include my testing module in just the "sdist" 
distribution?  My current call to setup() looks like::

     distutils.core.setup(
         ...
         py_modules=['argparse'],
     )

If change this to::

     distutils.core.setup(
         ...
         py_modules=['argparse', 'test_argparse'],
     )

then test_argparse.py gets included in the source distribution, but it 
also gets installed to site-packages like a normal module. I don't think 
I want that. If I change it to::

     distutils.core.setup(
         ...
         py_modules=['argparse'],
         scripts=['test_argparse.py'],
     )

then test_argparse.py gets included in the source distribution, but it 
also gets installed in the Python scripts directory. I don't think I 
want that either.

I want test_argparse.py to be available in the source distribution, but 
I don't think it should be included in the binary distributions.

Or am I just being to picky?  Do folks normally include their tests in 
the binary distributions?

STeVe



More information about the Python-list mailing list