用于定义包的基于yaml的文件包清单框架。
packageManifest的Python项目详细描述
python 3框架,用于创建和维护受python manifest.in启发的文件的通用清单。该框架通常用作某种打包工具的基础,以定义分发包所需的文件。
1 Main Features
- 基于yaml的文件格式
- 常见清单操作:
- 包括/排除
- 全局包含/排除
- 递归包含/排除
- 修剪/嫁接
3 Getting Started
manifest yaml文件只是一个包含或排除操作的列表,用于构成文件的公式。在那里 是六种不同类型的操作-与pythonMANIFEST.in相同。
每个include/exclude操作都可以接受files指令或directory指令,或者两者都接受,具体取决于 应用的include/exclude类型。
-include:files:['LICENSE','README.md']-exclude:files:['*.orig']-recursive-include:directory:'include'files:['*.h','*.c']-recursive-exclude:directory:'temp/subdir'files:['*']-global-include:files:['Makefile']-global-exclude:files:['*.txt','*.tmp','test']-prune:directory:'bin'-graft:directory:'src'
files指令包含要应用于文件的类unix glob模式的列表。 directory指令包含目录的单个字符串。
使用清单文件只是导入库并使用from_yamlFile类方法 导入操作并将其应用于要从中提取文件的目录树的指定根目录。
frompackage-manifestimportManifestthisManifest=Manifest.from_yamlFile('manifest.yml','.')manifestFiles=thisManifest.apply()
manifestFiles现在包含根目录'.'中的一组python文件名,这些文件名已被筛选 在文件manifest.yml中指定的操作。