How to exclude * .pyc and __pycache__ from python wheels?

What is the right way to exclude files from a python wheel distribution?

Editing MANIFEST.in has no effect, and I can not find information about this detail.

+8
python python-wheel
source share
1 answer

I have never had this problem.

Here is an excerpt from my setup.py :

  name='aenum', version='2.0.2', url='https://bitbucket.org/stoneleaf/aenum', packages=['aenum'], package_data={ 'aenum' : [ 'LICENSE', 'README', 'doc/aenum.rst', 'doc/aenum.pdf', ] }, include_package_data=True, license='BSD License', description="Advanced Enumerations (compatible with Python stdlib Enum), NamedTuples, and NamedConstants", long_description=long_desc, provides=['aenum'], author='Ethan Furman', author_email='...', classifiers=[ ... ], 

and my MANIFEST.in :

 exclude aenum/* include setup.py include README include aenum/__init__.py include aenum/test.py include aenum/test_v3.py include aenum/LICENSE include aenum/CHANGES include aenum/README include aenum/doc/aenum.pdf include aenum/doc/aenum.rst 

I would say that exclude aenum/* is what the trick does for me, so maybe exclude <package_name>/__pycache__ will work for you.

0
source share

All Articles