跳转到主要内容

setuptools插件,用于下载外部文件

项目描述

build status pre-commit.ci status

setuptools-download

setuptools插件,用于下载外部文件

用法

此插件旨在通过setuptools声明性元数据使用

download_*的值是一个类似ini的字符串,其中部分是文件名。

文件设置

  • url(必需):下载文件的URL
  • sha256(必需):下载文件的校验和
  • group + marker(可选或必需一起使用)
    • group:一个互斥组的名称
    • marker:一个PEP 508标记表达式(可以指定多次)
      • 仅支持:os_namesys_platformplatform_machine
  • extract + extract_path(可选或必需一起使用)
    • extract:如何提取下载的文件(ziptar
    • extract_path:从归档中提取的路径

示例

[options]
setup_requires = setuptools-download

[setuptools_download]
download_data_files =
    [share/example/data.txt]
    url = https://example.com/data.txt
    sha256 = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    [share/example/embedded]
    url = https://example.com/release-1.0.tar.gz
    sha256 = bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
    extract = tar
    extract_path = release-v1.0/share/example/embedded
download_scripts =
    [example-tool]
    group = example-tool-binary
    marker = sys_platform == "linux" and platform_machine == "x86_64"
    url = https://example.com/example-tool-linux-x86-64
    sha256 = ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
    [example-tool]
    group = example-tool-binary
    marker = sys_platform == "darwin" and platform_machine == "x86_64"
    marker = sys_platform == "darwin" and platform_machine == "arm64"
    url = https://example.com/example-tool-darwin-x86-64
    sha256 = ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
    [example-tool.exe]
    group = example-tool-binary
    marker = sys_platform == "win32" and platform_machine == "AMD64"
    url = https://example.com/example-tool-win32.exe
    sha256 = eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee

项目详情


下载文件

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

源分布

setuptools_download-1.1.0.tar.gz (5.8 kB 查看哈希值)

上传时间:

构建分布

setuptools_download-1.1.0-py2.py3-none-any.whl (6.3 kB 查看哈希值)

上传时间 Python 2 Python 3

支持