跳转到主要内容

将WDL及其导入打包成zip文件。

项目描述

将WDL及其导入打包成zip文件。

此zip文件可以作为cromwell的有效导入zip文件使用。它也可以用于存档您的工作流程。

wdl-packager可以创建带有--reproducible标志的二进制可重复创建zip包。它还可以包含额外的文件,如许可证、READMEs和示例配置文件。这使得它非常适合作为软件包分发WDL工作流程。

Wdl-packager 目前仅支持基于文件的导入。

用法

usage: wdl-packager [-h] [-o OUTPUT] [-a ADDITIONAL_FILES]
                    [--use-git-version-name] [--use-git-commit-timestamp]
                    [--reproducible] [--version]
                    WDL_FILE

positional arguments:
  WDL_FILE              The WDL file that will be packaged.

optional arguments:
  -h, --help            show this help message and exit
  -o OUTPUT, --output OUTPUT
                        The output zip file. By default uses the name of the
                        input. This overrides the git name option.
  -a ADDITIONAL_FILES, --additional-file ADDITIONAL_FILES
                        Additional files to be included in the zip. Additional
                        files will be added according to their relative
                        position to the WDL file. If that is not possible they
                        will be added to the base of the zip. Multiple '-a'
                        flags can be used.
  --use-git-version-name
                        Use git describe to determine the name of the zip.
  --use-git-commit-timestamp
                        Use the git commit timestamp to timestamp all the
                        files in the zip.
  --reproducible        shorthand for --use-git-version-name and --use-git-
                        commit-timestamp
  --version             show program's version number and exit

可重现性

创建可重现包的内部过程如下

  • 它使用 git log --n1 --pretty=%at 检查每个文件,以获取影响该文件的最新提交的 Unix 时间戳。

  • 然后,将每个文件复制到临时目录中,其中最后修改时间更改为第一步中找到的 Unix 时间戳。

  • 然后按 zip 中的目标路径对文件列表进行排序。排序确保文件始终以相同的顺序添加。

  • 将过程时区更改为 UTC,因为时区会影响 zip 存档中文件的时间戳。

  • 以排序顺序将文件添加到 zip 包中。

可重现包的名称由以下内容组成

  • 不带 .wdl 的 WDL 文件基本名。

  • 通过 git describe --always 描述的版本。

  • .zip 扩展名。

已知问题

  • 旧版本的 Cromwell 存在一个错误,导致打开嵌套目录的 zip 文件时崩溃。这个问题在 cromwell 版本 49 中已修复。

  • 目前不支持 http:// 导入。Wdl-packager 可以是一个理想的工具,从网络获取 WDL 并将它们的导入打包,以便在本地上使用。不幸的是,这需要在打包之前重新编写 WDL 文件中的导入路径。这难以实现,并可能产生意外的副作用。

  • 在可重现打包时,需要将 Python 进程的时区更改为“UTC”。否则,zip 中的最后修改时间将因时区而异。这会影响同一进程中运行的所有代码。这对 wdl-packager 本身来说不重要,但对于将 wdl_packager 作为库使用的程序来说很重要。不使用 use_git_timestamps 可以避免这个问题。

项目详情


下载文件

下载您平台的文件。如果您不确定选择哪个,请了解有关 安装包 的更多信息。

源分布

wdl-packager-1.0.0.tar.gz (8.9 kB 查看哈希)

上传时间

构建分布

wdl_packager-1.0.0-py3-none-any.whl (12.1 kB 查看哈希)

上传时间 Python 3

由以下机构支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面