今天看Flask的文档,里面提到如何通过distribute发布你自己的Python包。讲包含文件的时候,提到要用MANIFEST.in并将include_package_data设置为True。 由于我自己也发布过几个包,当时并没有设置include_package_data,而且看lxyu的包setup.py里面设置的是package_data,所以就想搞清楚到底是怎么回事。 Google了一会,最终搞清...
使用MANIFEST.in设置include_package_data=True
通过setup函数的参数packages、include_package_data(其实就是MANIFEST.in文件)、exclude_package_data、package_data、data_files来指定需要打包的文件。 包含的文件如下: py_modules和packages 参数指定所有 Python 源文件 package_data和data_files 参数指定所有数据文件。data_files指定安装过程中,需要安装的静态文件,如...
admin=Windows下用户可以使用管理员权限来安装 --linux-onefile-icon=Linux下的图标位置 --onefile 像pyinstaller打包成单个exe文件 --include-package=复制比如numpy,PyQt5 这些带文件夹的叫包或者轮子 --include-module=复制比如when.py 这些以.py结尾的叫模块–-include-package-data=包含给定软件包名称中的数据...
setup(name='my_package',version='1.0',packages=['my_package'],include_package_data=True,) 1. 2. 3. 4. 5. 6. 7. 8. 通过在setup()函数中设置include_package_data=True参数,setuptools会自动查找项目目录下的MANIFEST.in文件,并根据其中的内容来设置package_data参数。
2、include_package_data 参数到底需不需要? 我找了很多关于这个参数的描述,我感觉都没有解释清楚这个参数的作用,而我经过验证算是有个初步的理解。这个参数默认应该是 True,也就是说你不添加就默认是 True。它的作用是对 bdist_wheel 打包命令生效的,前面说到了 MANIFEST.in 文件可以来定义一些非 Python 包的文...
package_data:一般写成{‘your_package_name’: [“files”]}, include_package_data还没完,还需要修改MANIFEST.in文件.MANIFEST.in文件的语法为: include xxx/xxx/xxx/.ini/(所有以.ini结尾的文件,也可以直接指定文件名) license : 支持的开源协议 description : 对项目简短的一个形容 ext_modules : 是一个...
exclude_package_data={ 'bandwidth_reporter':['*.txt'] } ) 除了以上的参数配置之外,还可以使用一个叫做 MANIFEST.in 的文件,来控制文件的分发。 如下这是一个 MANIFEST.in 的样例: include *.txt recursive-include examples *.txt *.py prune examples/sample?/build ...
It spares you the need to find the package directory yourself and should be preferred whenever available. Functionally it's very similar to --include-data-dir but it has the benefit to locate the correct folder for you. With data files, you are largely on your own. Nuitka keeps track of...
If you're working with a multi-threaded app that uses native thread APIs (such as the Win32CreateThreadfunction rather than the Python threading APIs), it's presently necessary to include the following source code at the top of whichever file you want to debug: ...