bex-hooks-python
Python-related hooks for bex. This package provides hooks to create and manage Python virtual environments and their dependencies.
Usage
bex-hooks-python is available on PyPI.
Add the plugin package to the requirements section of your bex bootstrap header:
# /// bootstrap
# requires-python: ">=3.11,<3.12"
# requirements: |
# bex-hooks
# bex-hooks-python
# entrypoint: bex_hooks.exec:main
# ///
Then enable the plugin in your configuration:
config:
plugins:
- bex_hooks.hooks.python
Hooks
python/setup-python
Sets up a Python virtual environment for a specified version and synchronizes its dependencies using uv. When both requirements and requirements_file are provided, their contents are merged into a single set of requirements.
Arguments
| Name | Type | Default | Description |
|---|---|---|---|
version |
str |
(required) | Python version to provision (e.g. ">=3.11,<3.12") |
uv |
str | None |
None |
Version of uv to use |
requirements |
str |
"" |
Inline requirements (e.g. "requests==2.32.0"). |
requirements_file |
list[str] |
[] |
One or more requirements file paths. |
activate_env |
bool |
False |
If True, activates the environment for subsequent steps. |
set_python_path |
bool |
False |
If True, sets PYTHONPATH to the virtual environment. |
inexact |
bool |
False |
If True, tells uv not to remove dependencies that are present but not declared in the requirements. |
Example
hooks:
- id: python/setup-python
version: ">=3.11,<3.12"
uv: "0.4.0"
requirements_file:
- requirements.txt
requirements: |
requests==2.32.0
activate_env: true
inexact: true
Metadata
Release files for bex-hooks-python 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bex_hooks_python-0.1.1.tar.gz | 7.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bex_hooks_python-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.8 kB
Release files / bex_hooks_python-0.1.1.tar.gz
| Download URL | bex_hooks_python-0.1.1.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7225c2330c068ee07a550ba9233f9ac7aedb1acf44d13f9cda146c9a73383742
|
|
BLAKE2b-256 checksum How to use checksums |
ed650a018d982306c4b4020955c98ab61526a52b2d5ceb6275521c0b3f877038
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / bex_hooks_python-0.1.1-py3-none-any.whl
| Download URL | bex_hooks_python-0.1.1-py3-none-any.whl |
|---|---|
| Size | 9.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e4a9890e68253762c1ecd4aeb8362a3844102e694cd3f1c774174a5adb371ce1
|
|
BLAKE2b-256 checksum How to use checksums |
cde90c49f7b68dfcef02118e02c470cc8f9f727007ccbd0d3d920a7d8309217e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|