Can I use setup.py to ship and install only .pyc files?

M

Mike Kent

I'd like to ship only the .pyc files for a module. I was hoping the
standard distutils setup.py could handle this, but so far, I've not
figured out how.

After a bit of work, I discovered that if I create a MANIFEST.in file,
and put 'include mymodule/*.pyc' and 'exclude mymodule/*.py' in it,
then running 'python setup.py sdist' would generate a tar.gz file for
me that contained the setup.py file and all my .pyc files, just like I
wanted. However, when I then extract that tar.gz file, and try to run
'python setup.py install', it complains about the missing .py files,
and creates the 'mymodule' directory in the site-packages directory
but without putting any of the .pyc files in it.

At this point, I'm stumped. I was hoping someone out there had gone
down this same route and could tell what I'm doing wrong. Can
setup.py even handle this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top