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.1.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.1-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bex_hooks_python-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 7225c2330c068ee07a550ba9233f9ac7aedb1acf44d13f9cda146c9a73383742
MD5 f87ec1aad53e19af21d8140d689e8032
BLAKE2b-256 ed650a018d982306c4b4020955c98ab61526a52b2d5ceb6275521c0b3f877038

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bex_hooks_python-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e4a9890e68253762c1ecd4aeb8362a3844102e694cd3f1c774174a5adb371ce1
MD5 fcbe27a78c43226570fd31e50585942b
BLAKE2b-256 cde90c49f7b68dfcef02118e02c470cc8f9f727007ccbd0d3d920a7d8309217e

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