setuptools-download is a plugin for setuptools that enables the declarative downloading of external files as part of a Python package's build process. It allows specifying URLs, SHA256 checksums, and extraction methods (zip, tar) directly within the `pyproject.toml` or `setup.cfg` file. Currently at version 1.1.0, it is actively maintained with infrequent but targeted releases.
pip install setuptools-downloadNo compatibility data collected yet for this library.
setuptools-download is configured declaratively, typically in `pyproject.toml` under the `[tool.setuptools-download]` section. Each download is defined by a unique key (e.g., `download_example_asset`) with required `url` and `sha256` fields, and an optional `dest` field. After configuration, running `python -m build` will execute the download as part of the source distribution (sdist) or wheel (bdist_wheel) build process. Replace `url` and `sha256` with your actual file and its checksum.
Always provide the correct SHA256 checksum for each file you intend to download.
Prefer using `pyproject.toml` (recommended) or `setup.cfg` to define download operations.
Pin your `setuptools` version in `pyproject.toml`'s `build-system.requires` (e.g., `setuptools>=61.0,<80.0.0`) and regularly test against newer `setuptools` releases.
Add `setuptools-download` to the `build-system.requires` list in `pyproject.toml` (e.g., `requires = ["setuptools>=61.0", "setuptools-download"]`) or `setup_requires` in `setup.py`.
Update the SHA256 checksum in your `pyproject.toml` or `setup.cfg` to match the correct hash of the downloaded file, or verify the URL points to the expected file.
Verify the URL is correct and accessible, check your internet connection, ensure any proxy settings are configured properly, or try downloading the file manually to diagnose the issue.
Review your `download_data` configuration in `pyproject.toml` or `setup.cfg` against the `setuptools-download` documentation to ensure all required fields are present and correctly formatted.