我目前的MANIFEST.in和setup.py(并且不包括PyPI在线文档中的图像)如下:
MANIFEST.in
include liCENSEinclude README.mdinclude images/*include setup.pyinclude junkmodule.py
setup.py
#!/usr/bin/python# -*- Coding: utf-8 -*-import osimport setuptoolsdef main(): setuptools.setup( name = "junkmodule",version = "0.0.0.1",description = "provIDes nothing much",long_description = Markdown_to_reStructuredText("README.md"),url = "https://github.com/junkuser1/junkmodule",author = "L. Ron. Hubbard",author_email = "lrh@sern.ch",license = "GPLv3",py_modules = ["junkmodule"],entry_points = """ [console_scripts] junkmodule = junkmodule:junkmodule """ )def read(*paths): with open(os.path.join(*paths),"r") as filename: return filename.read()def Markdown_to_reStructuredText(filename): try: import pypandoc return pypandoc.convert(filename,"rst") except: print("pypandoc not found; long description Could be corrupted") return read(filename)if __name__ == "__main__": main()解决方法 A possible solution将在GitHub上托管图像,并从那里获取README中的图像.我亲自在 commit,this result进行了测试. 总结
以上是内存溢出为你收集整理的如何将图像添加到Python包索引文档?全部内容,希望文章能够帮你解决如何将图像添加到Python包索引文档?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)