{"id":5047,"library":"rust-just","title":"Just (Python Wrapper)","description":"rust-just is a Python wrapper for the `just` command runner, a powerful and simpler alternative to Make for project-specific task automation. It allows Python applications to programmatically invoke `just` recipes defined in a `Justfile`. The current version, 1.49.0, aligns with the version of the underlying `just` command-line tool, which maintains an active development cycle with frequent updates.","status":"active","version":"1.49.0","language":"en","source_language":"en","source_url":"https://github.com/gnpaone/rust-just","tags":["task runner","cli wrapper","build automation","rust"],"install":[{"cmd":"pip install rust-just","lang":"bash","label":"Install Python wrapper"},{"cmd":"curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash","lang":"bash","label":"Install Just CLI (Linux/macOS)"},{"cmd":"choco install just","lang":"bash","label":"Install Just CLI (Windows via Chocolatey)"}],"dependencies":[],"imports":[{"note":"The PyPI package `rust-just` exposes the `Just` class directly under the `just` module name.","wrong":"import rust_just","symbol":"Just","correct":"from just import Just"}],"quickstart":{"code":"import os\nimport subprocess\n\n# Create a dummy Justfile for demonstration\njustfile_content = \"\"\"\nhello:\n  echo 'Hello from Just!'\n\ngreet NAME=\\\"World\\\":\n  echo \"Hello, {{NAME}}!\"\n\nfail:\n  exit 1\n\"\"\"\n\nwith open('Justfile', 'w') as f:\n    f.write(justfile_content)\n\ntry:\n    from just import Just\n    just_runner = Just()\n\n    print(\"Running 'hello' recipe:\")\n    result_hello = just_runner.run(recipe='hello')\n    print(f\"Output: {result_hello.stdout.strip()}\\n\")\n\n    print(\"Running 'greet' recipe with argument:\")\n    result_greet = just_runner.run(recipe='greet', args=['NAME=Pythonista'])\n    print(f\"Output: {result_greet.stdout.strip()}\\n\")\n\n    print(\"Attempting to run a non-existent recipe (expected error):\")\n    try:\n        just_runner.run(recipe='non_existent')\n    except subprocess.CalledProcessError as e:\n        print(f\"Caught expected error: {e.stderr.strip().splitlines()[0]} [...]\")\n\n    print(\"Attempting to run 'fail' recipe (expected error):\")\n    try:\n        just_runner.run(recipe='fail')\n    except subprocess.CalledProcessError as e:\n        print(f\"Caught expected error with return code {e.returncode}\\n\")\n\nfinally:\n    # Clean up the dummy Justfile\n    if os.path.exists('Justfile'):\n        os.remove('Justfile')\n","lang":"python","description":"This quickstart demonstrates how to use the `rust-just` wrapper to execute recipes defined in a `Justfile`. It shows how to run a simple recipe, a recipe with arguments, and handles expected errors when recipes fail or don't exist. It also sets up a temporary `Justfile` for a runnable example."},"warnings":[{"fix":"Ensure the `just` executable is installed and available in your system's PATH. Refer to https://just.systems/#installation for detailed installation instructions for your operating system.","message":"The `rust-just` Python package acts as a wrapper for the `just` command-line executable. Installing `rust-just` via pip DOES NOT install the `just` binary itself. You must install the `just` command-line tool separately on your system for the wrapper to function.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always check the `just` command-line tool's changelog (https://github.com/casey/just/releases) when upgrading or encountering unexpected behavior. Ensure your installed `just` binary matches the version expected by the Python wrapper for optimal compatibility.","message":"The version of the `rust-just` Python package typically mirrors the version of the underlying `just` command-line tool it is designed to wrap. While the Python wrapper's API is generally stable, functionality changes, new features, or breaking changes in the `just` tool's CLI (e.g., recipe syntax, new flags) will only be reflected if a compatible `just` binary is installed and the wrapper is updated.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Verify that `just` is correctly installed and its directory is included in the system's PATH. You can test this by running `just --version` in your terminal.","message":"If the `just` executable is not found in the system's PATH when `just_runner.run()` is called, it will raise a `subprocess.CalledProcessError` or `FileNotFoundError` (depending on the Python version and specific error scenario).","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}