[![build status](https://github.com/asottile/setuptools-download/actions/workflows/main.yml/badge.svg)](https://github.com/asottile/setuptools-download/actions/workflows/main.yml)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/asottile/setuptools-download/main.svg)](https://results.pre-commit.ci/latest/github/asottile/setuptools-download/main)
setuptools-download
===================
setuptools plugin to download external files
## usage
this plugin is intended to be used through setuptools declarative metadata:
the value of `download_*` is an ini-like string with the section being the
filename.
### file settings
- `url` (required): url to download the file from
- `sha256` (required): checksum of the downloaded file
- `group` + `marker` (optional or required together)
- `group`: a name for a mutually exclusive group
- `marker`: a [PEP 508 marker expression] (can be specified multiple times)
- only supports: `os_name`, `sys_platform`, `platform_machine`
- `extract` + `extract_path` (optional or required together)
- `extract`: how to extract the downloaded file (`zip` or `tar`)
- `extract_path`: path to extract from archive
[PEP 508 marker expression]: https://peps.python.org/pep-0508/#environment-markers
### example
```ini
[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
```
Raw data
{
"_id": null,
"home_page": "https://github.com/asottile/setuptools-download",
"name": "setuptools-download",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Anthony Sottile",
"author_email": "asottile@umich.edu",
"download_url": "https://files.pythonhosted.org/packages/7f/63/a8dd51f599b21cbd34e09485e6086e9b1aa9d0b0f6b749b7e4efab8f3727/setuptools_download-1.1.0.tar.gz",
"platform": null,
"description": "[![build status](https://github.com/asottile/setuptools-download/actions/workflows/main.yml/badge.svg)](https://github.com/asottile/setuptools-download/actions/workflows/main.yml)\n[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/asottile/setuptools-download/main.svg)](https://results.pre-commit.ci/latest/github/asottile/setuptools-download/main)\n\nsetuptools-download\n===================\n\nsetuptools plugin to download external files\n\n## usage\n\nthis plugin is intended to be used through setuptools declarative metadata:\n\nthe value of `download_*` is an ini-like string with the section being the\nfilename.\n\n### file settings\n\n- `url` (required): url to download the file from\n- `sha256` (required): checksum of the downloaded file\n- `group` + `marker` (optional or required together)\n - `group`: a name for a mutually exclusive group\n - `marker`: a [PEP 508 marker expression] (can be specified multiple times)\n - only supports: `os_name`, `sys_platform`, `platform_machine`\n- `extract` + `extract_path` (optional or required together)\n - `extract`: how to extract the downloaded file (`zip` or `tar`)\n - `extract_path`: path to extract from archive\n\n[PEP 508 marker expression]: https://peps.python.org/pep-0508/#environment-markers\n\n### example\n\n```ini\n[options]\nsetup_requires = setuptools-download\n\n[setuptools_download]\ndownload_data_files =\n [share/example/data.txt]\n url = https://example.com/data.txt\n sha256 = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n [share/example/embedded]\n url = https://example.com/release-1.0.tar.gz\n sha256 = bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\n extract = tar\n extract_path = release-v1.0/share/example/embedded\ndownload_scripts =\n [example-tool]\n group = example-tool-binary\n marker = sys_platform == \"linux\" and platform_machine == \"x86_64\"\n url = https://example.com/example-tool-linux-x86-64\n sha256 = ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\n [example-tool]\n group = example-tool-binary\n marker = sys_platform == \"darwin\" and platform_machine == \"x86_64\"\n marker = sys_platform == \"darwin\" and platform_machine == \"arm64\"\n url = https://example.com/example-tool-darwin-x86-64\n sha256 = ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\n [example-tool.exe]\n group = example-tool-binary\n marker = sys_platform == \"win32\" and platform_machine == \"AMD64\"\n url = https://example.com/example-tool-win32.exe\n sha256 = eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "setuptools plugin to download external files",
"version": "1.1.0",
"project_urls": {
"Homepage": "https://github.com/asottile/setuptools-download"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0d1ab49efff1c04e5aa0dd09415d0f0c0a2d75c7735e78b0fa18a7864d3d260c",
"md5": "1bbcb3be544d2ea833e4bd0f8beca413",
"sha256": "f11d92f40622df97390e249316366f868cbcdd1100a7569d0f22973e405028f7"
},
"downloads": -1,
"filename": "setuptools_download-1.1.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "1bbcb3be544d2ea833e4bd0f8beca413",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.8",
"size": 6298,
"upload_time": "2024-07-07T22:59:30",
"upload_time_iso_8601": "2024-07-07T22:59:30.488150Z",
"url": "https://files.pythonhosted.org/packages/0d/1a/b49efff1c04e5aa0dd09415d0f0c0a2d75c7735e78b0fa18a7864d3d260c/setuptools_download-1.1.0-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7f63a8dd51f599b21cbd34e09485e6086e9b1aa9d0b0f6b749b7e4efab8f3727",
"md5": "6357587b50e120333b69b591f6b51156",
"sha256": "f91f1b6b73104b064519759688d2ccfb37e955a5e475d64526474f248f66a7b6"
},
"downloads": -1,
"filename": "setuptools_download-1.1.0.tar.gz",
"has_sig": false,
"md5_digest": "6357587b50e120333b69b591f6b51156",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 5843,
"upload_time": "2024-07-07T22:59:32",
"upload_time_iso_8601": "2024-07-07T22:59:32.345660Z",
"url": "https://files.pythonhosted.org/packages/7f/63/a8dd51f599b21cbd34e09485e6086e9b1aa9d0b0f6b749b7e4efab8f3727/setuptools_download-1.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-07 22:59:32",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "asottile",
"github_project": "setuptools-download",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "setuptools-download"
}