How to include non.py files in PyPI?

I'm new to PyPI ... so give me the right to do this. I am trying to install a package on PyPI, but with slight problems when I try to install it using pip. When I upload a file to PyPI, I get a warning (but setup.py script ends with non-fatal errors and status 200):

'my_package/static/my_folder' not a regular file -- skipping 

And then, when I go to install it in pip, I get an error:

 "error: can't copy 'my_package/static/my_folder': doesn't exist or not a regular file. 

From other answers on SO, I tried changing my MANIFEST.in files and my setup.py files, no luck. Here is my current MANIFEST.in:

 recursive-include my_package *.css *.js *.jinja2 

and setup.py:

 try: from setuptools import setup, find_packages except ImportError: from distutils.core import setup, find_packages setup( name='my_package', packages=find_packages(), include_package_data=True, platforms='any', version='1.0', description='my_description', license='MIT', author='Me', author_email=' me@example.com ', install_requires=[ 'Flask', 'Jinja2', 'requests', ], url='http://www.example.com', download_url='https://github.com/me/my_package/tarball/1.0', classifiers=[ 'License :: OSI Approved :: MIT License', ], ) 

EDIT: I also tried leaving the MANIFEST.in file to make sure that something is wrong, but I get the same result.

+6
source share
1 answer

(Sent from a comment on request.)

Your setup script and MANIFEST.in should work. To prove this with a minimal example:

 my_project/ my_package/ static/ a.css __init__.py MANIFEST.in setup.py 

Run python setup.py sdist and you will find that both static/a.css and __init__.py are included in the tar.gz package.

+2
source

All Articles