DEV Community

Cover image for 🚀 Announcing Pythonaibrain-Warden (v0.1.0): Industrial-Grade, npm-Inspired Package & Environment Manager for Python
Divyanshu Sinha
Divyanshu Sinha

Posted on

🚀 Announcing Pythonaibrain-Warden (v0.1.0): Industrial-Grade, npm-Inspired Package & Environment Manager for Python

I am excited to announce the official release of warden (pythonaibrain-warden v0.1.0)!

Python package management often forces developers to choose between low-level speed and high-level reproducibility. I built warden to bridge this gap by introducing an npm-inspired workflow centered on a deterministic lockfile architecture, native virtual environment isolation, and hard offline build guarantees.


🌟 Why I Built warden

  • 🔐 Deterministic Lockfile Enforcement (warden.lock): warden locks exact artifact URLs and SHA-256 hashes. Every installation executes via pip install <exact-artifact> --no-deps, preventing pip's resolver from silently substituting different package versions.

  • 🔌 Thin CLI over Core API Architecture: I designed every CLI subcommand as a light wrapper around warden.core. Whether called from terminal scripts, unit tests, or programmatically via import warden.core as core, execution behavior remains identical.

  • 🛠️ Warden-Native Environments & Absolute Paths: warden wenv constructs standard CPython virtual environments natively. Subprocess calls resolve executables to absolute paths inside the active environment (resolve_executable), eliminating cross-platform PATH resolution bugs on Windows.

  • 🎯 Per-File Dependency Targets: Need to run two files with mutually exclusive package requirements in the same repository? warden target set provisions isolated sub-environments (.warden/venvs/target-<slug>/) and dedicated lockfiles, allowing scripts like numpy==1.24.0 and numpy==1.26.4 to live side-by-side.

  • 🏷️ Platform Wheel Selection: Artifact resolution ranks PyPI binaries against packaging.tags.sys_tags(), preventing platform mismatch errors on C-extension wheels.

  • 🛑 fix vs. install Separation: warden fix repairs installed-vs-locked environment drift without ever modifying project requirements in warden.toml or warden.lock.

  • 📦 Self-Contained Offline Bundling (.warden.wheel): warden build packages project source code, manifests, locked dependencies, and build-system tools (setuptools/wheel) into zero-network archives.

  • 🚦 CI Reproducibility Gate (warden verify): Runs deep validation across manifests, lockfile consistency, SHA-256 digests, and active environment states with stable non-zero exit codes on failure.


⚡ Quick Start

# Install warden from PyPI
pip install pythonaibrain-warden==0.1.0

# Initialize a new project layout
warden init myapp
cd myapp

# Add dependencies & sync active environment
warden install requests
warden install "flask@3.0.0"

# Execute project entry point or verify reproducibility
warden run
warden verify

Enter fullscreen mode Exit fullscreen mode

📋 Command Summary

Category Commands
Dependencies installupdateuninstalllock
Environments wenvusefix
Execution runrun-fileexectarget
Quality & Audit verifyshowcleancache
Bundles & Deploy buildinstall-wheelbackuprestorepublish

🌐 Links & Resources

Top comments (0)