Metadata-Version: 2.1
Name: pre-commit-download
Version: 0.1.0
Summary: Build-backend for downloading external single file binaries.
Author-email: Pavel Kolomytsev <pkolomytsev@gmail.com>
Project-URL: Homepage, https://github.com/pkolomytsev/pre-commit-download
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Software Development
Classifier: Typing :: Typed
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: setuptools ~=69.0
Requires-Dist: tomli ~=2.0
Provides-Extra: dev
Requires-Dist: pre-commit ==3.5.0 ; extra == 'dev'
Requires-Dist: nox ==2024.4.15 ; extra == 'dev'
Requires-Dist: build ==1.2.1 ; extra == 'dev'
Requires-Dist: twine ==5.0.0 ; extra == 'dev'
Requires-Dist: pre-commit-download[lint] ; extra == 'dev'
Requires-Dist: pre-commit-download[test] ; extra == 'dev'
Provides-Extra: lint
Requires-Dist: Flake8-pyproject ==1.2.3 ; extra == 'lint'
Requires-Dist: wemake-python-styleguide ==0.18.0 ; extra == 'lint'
Requires-Dist: mypy ==1.10.0 ; extra == 'lint'
Requires-Dist: black ==24.4.2 ; extra == 'lint'
Provides-Extra: test
Requires-Dist: pytest ==8.2.0 ; extra == 'test'

# pre-commit-download

Custom PEP 517 compatible build-backend based on `setuptools.build_meta` for
downloading and installing single-file binaries during building wheel.

## Usage

All binary requirements must be defined in the `pyproject.toml`.

Schema:

<!-- markdownlint-disable MD013 -->

```toml
[build-system]
requires = [
    "pre-commit-download~=0.1.0",
]
build-backend = "pre_commit_download.hooks"

[tool.pre-commit-download]
install_root = "src/<module_name>/bin"  # optional, defaults to **/<module_name>

[tool.pre-commit-download.binaries]
"<executable-name>" = [
    {sys_platform = "<sys.platform>", platform_machine = "<platform.machine()>", extract_method = "<tarfile|zipfile>", extract_path = "<executable-name-v1.0.0/executable-name>", exec_suffix="<str>", url = "https://..."},
    {...},
]
"<executable-name>" = [
    {...},
]
```

<!-- markdownlint-enable MD013 -->

Required parameters:

- `<executable-name>` - the name of executable file(s) without extension
- `sys_platform` - compares to `sys.platform`
- `platform_machine` - compares to `platform.machine()`
- `url` - source URL

Optional parameters:

- `install_root` - a relative path from the project root there executables
  should be installed, default to the client's module name
- `exec_suffix` - optional, a platform specified executable suffix (like `exe`)
- `extract_method` - optional, an archive unpacking provider (`tarfile` or
  `zipfile`); not required if `url` points to unpacked file
- `extract_path` - optional, a relative path to the executable inside the
  archive, defaults to `<executable-name>` + `<exec_suffix>` (if defined);
  not required if `url` points to unpacked file
