Jubilant is a Python library that provides a high-level, asynchronous wrapper around the Juju CLI, primarily designed for integration testing of Juju charms. It simplifies programmatic interactions with Juju controllers and models, allowing for automation of deployments, configurations, and status checks. The library is actively maintained by Canonical, with frequent minor releases, and is currently at version 1.8.0.
pip install jubilantVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the `Juju` client, add a temporary Juju model, deploy a charm, wait for its status, and then destroy the model. This example is asynchronous and requires the 'juju' CLI to be installed and configured on your system. Using `Juju.temp_model()` as a context manager is generally preferred for testing scenarios to ensure cleanup.
Review all calls to `Juju.offer()` in your codebase. Explicitly provide the `model` argument (e.g., `model=my_model_name`) if the offer needs to target a specific model that is not the default for the `Juju` instance.
Install the Juju CLI (e.g., `snap install juju --classic` on Linux, or follow official Juju documentation for other platforms) and ensure its executable is in your system's PATH. You can verify the installation by running `juju --version` in your terminal.
Instead of `pip install jubilant`, use `pip install jubilant-backports`. In your Python code, change your imports from `from jubilant import Juju` to `import jubilant_backports as jubilant` (or `from jubilant_backports import Juju`) to maintain API compatibility.
Review any code utilizing `all_*` or `any_*` helpers. If your logic previously assumed these helpers would exclude subordinate units, you may need to adjust your expectations or filtering mechanisms.
Open your terminal or command prompt and run `pip install jubilant` to install the library.
Install the Juju CLI according to the official Juju documentation for your operating system (e.g., `snap install juju --classic` on Linux), and ensure its installation directory is added to your system's PATH environment variable. Verify by running `juju --version` in a new terminal session.
Carefully check the names of applications, models, and other Juju entities used in your Jubilant calls. Ensure they match your Juju environment exactly and that the Juju controller and model are in the expected operational state before the call is made.
Ensure you are running your Python code with Python 3.8 or a newer version to support the required syntax and `asyncio` features.
No dependency data recorded yet.