Skip to main content

bex-hooks-python

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bex_hooks_python-0.1.0.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bex_hooks_python-0.1.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file bex_hooks_python-0.1.0.tar.gz.

File metadata

  • Download URL: bex_hooks_python-0.1.0.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for bex_hooks_python-0.1.0.tar.gz
Algorithm Hash digest
SHA256 85ec3da54f389555ec1e5220ac8057b095713b473859e3d12d71f3dc0adae120
MD5 7e82e940854fd7cb54090ab4a5574737
BLAKE2b-256 fc652c1378ec013ccd057fa1007f856a4d9227ed81d9ecc7571e9b2286436d90

See more details on using hashes here.

File details

Details for the file bex_hooks_python-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bex_hooks_python-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for bex_hooks_python-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 871603e0eac6b7ea48f9d15b94f170c3b4f4df8eab56858ee5bcae0f5d475736
MD5 444170da9ccfcdbc022a9663676541ae
BLAKE2b-256 dc325963e7b5321a2feb189fb7fd363cb2e9414d612b7899c4eb5562b4592910

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page