PyPI sdist doesnt contain Readme.md
jayvdb opened this issue · 7 comments
setup.py opens Readme.md, which is missing from the sdist on PyPI.
The typical way to solve this is by adding a MANIFEST.in
to the repo.
Do I just add an empty file called MANIFEST.in ?
No, it has contents that describe what should be included in the sdist.
e.g. https://github.com/terra-project/jigu/pull/13/files
google "setuptools manifest.in"
Hi, I just searched it up and people say you don't need it?
do python projects need a manifest.in and what should be in it
If the setup.py does not read any files, a MANIFEST.in is not needed.
So you can remove the read's from setup.py
, or create a MANIFEST.in
, or use pbr
or many other more complicated solutions. Whatever solution you take, you can test it by building the sdist
, and then unpack the sdist in an empty directory and try to run setup.py install
. If it doesnt install, the sdist is not working.
It is also possible to only distribute wheels, and not distribute an sdist.
Currently, my setup.py only uses Readme.md, So then my MANIFEST.in should be like this right
include README.md
yes, however it is also necessary to create a LICENSE file, and then it is a good idea to add
include LICENSE
Newer setuptools can automatically find LICENSE
, however explicitly listing it ensures it is included, even in an default venv without a recent setuptools. I see lots of sdists uploaded without the LICENSE file, and I am assuming it is because an older setuptools is somehow unexpectedly being used.
downloading package wasmite-0.2.1...
from https://files.pythonhosted.org/packages/source/w/wasmite/wasmite-0.2.1.tar.gz
generating spec file for wasmite...
Traceback (most recent call last):
File "setup.py", line 23, in <module>
long_description=open('Readme.md').read(),
FileNotFoundError: [Errno 2] No such file or directory: 'Readme.md'