Skip to main content

No project description provided

Project description

liblaf-nox-recipes keeps noxfile.py sessions small by packaging the uv, pytest, and CUDA glue you would otherwise repeat across repositories.

✨ Features

  • 💨 Bootstrap uv-managed environments in one call: setup_uv() compiles constraints from pyproject.toml, resolves the dependency groups you ask for, syncs the session environment, and installs the current project in editable mode.
  • 📉 Exercise multiple dependency strategies: Resolution exposes highest, lowest, and lowest-direct modes so you can cover both everyday development and lower-bound compatibility in CI.
  • 🧪 Keep test sessions short without hiding pytest: pytest() forwards s.posargs, supports per-session environment variables, and keeps shared flags out of each @nox.session.
  • Run CodSpeed-friendly benchmarks: pytest_bench() adds the benchmark marker, --codspeed, and single-process defaults when helpers like pytest-xdist are installed.
  • 🖥️ Skip GPU-only jobs safely: supports_cuda() and cuda_driver_version() use NVML to decide whether CUDA-specific sessions should run.

📦 Installation

[!NOTE] liblaf-nox-recipes requires Python 3.12+ and expects uv to be available anywhere your nox sessions run.

uv add --dev liblaf-nox-recipes

If you also want uv to create and manage the virtual environments that nox uses, install nox-uv and set nox.options.default_venv_backend = "uv" in your noxfile.py.

🚀 Quick Start

from typing import Any

import nox

from liblaf import nox_recipes as recipes
from liblaf.nox_recipes import Resolution

nox.options.default_venv_backend = "uv"
nox.options.reuse_existing_virtualenvs = True

PYPROJECT: dict[str, Any] = nox.project.load_toml("pyproject.toml")
PYTHON_VERSIONS: list[str] = nox.project.python_versions(PYPROJECT)


@nox.session(python=PYTHON_VERSIONS, reuse_venv=True, tags=["test"])
@nox.parametrize(
    "resolution",
    [
        nox.param(Resolution.HIGHEST, id="highest"),
        nox.param(Resolution.LOWEST_DIRECT, id="lowest-direct"),
    ],
)
def test(s: nox.Session, resolution: Resolution) -> None:
    recipes.setup_uv(s, groups=["test"], resolution=resolution)
    recipes.pytest(s, suppress_no_test_exit_code=True)

Start with setup_uv() for the common case. When you need finer control, drop down to uv_pip_compile(), uv_pip_sync(), and uv_pip_install() directly. For GPU-only jobs, guard the session with supports_cuda() before doing any CUDA-dependent work.

⌨️ Local Development

git clone https://github.com/liblaf/nox-recipes.git
cd nox-recipes
mise run install
nox
mise run docs:serve

nox executes the test-tagged matrix from noxfile.py, and mise run docs:serve rebuilds the docs site that also embeds this README.

🤝 Contributing

Focused issues and pull requests are welcome. Please run nox before opening a PR, and rebuild the docs with mise run docs:serve when you change documentation or public APIs.

PR WELCOME

Contributors


📝 License

Copyright © 2026 liblaf.
This project is MIT licensed.

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

liblaf_nox_recipes-0.1.5.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

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

liblaf_nox_recipes-0.1.5-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file liblaf_nox_recipes-0.1.5.tar.gz.

File metadata

  • Download URL: liblaf_nox_recipes-0.1.5.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for liblaf_nox_recipes-0.1.5.tar.gz
Algorithm Hash digest
SHA256 72d1281129ef6a92bd04237640bc47ae7702a6d12ebbc34132edddfae02f5fcb
MD5 10d83f6fd041b840ae85301bb0691345
BLAKE2b-256 c1082eb6f69bd8133c99cd1085d8667471cf25358454f7de945c0b2a3553ef58

See more details on using hashes here.

Provenance

The following attestation bundles were made for liblaf_nox_recipes-0.1.5.tar.gz:

Publisher: python-release.yaml on liblaf/nox-recipes

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file liblaf_nox_recipes-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for liblaf_nox_recipes-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 2930bb5ff535b1b3b8ce8414a589d1cfcf88f51a130f720f38cbab42388f875b
MD5 370210ddb72d75f16c68eb79fc98af9c
BLAKE2b-256 7397582b2da1950c73ac04259e7e550c4e4b82d2fe4b1a3808841fe4238f74a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for liblaf_nox_recipes-0.1.5-py3-none-any.whl:

Publisher: python-release.yaml on liblaf/nox-recipes

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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