The `taskcluster` library is a comprehensive Python client for interacting with the Taskcluster API. It provides both synchronous and asynchronous interfaces for all Taskcluster API methods, allowing users to define, schedule, and manage tasks within the Taskcluster continuous integration and continuous delivery (CI/CD) system. Currently at version 99.0.3, the library maintains a rapid release cadence, with its version numbers co-versioned with the main Taskcluster platform.
pip install taskclusterVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize a synchronous Taskcluster client, typically configured via environment variables. It attempts to fetch the status of the Taskcluster Queue service as a basic connectivity test. It also shows how to import the asynchronous client module. For authentication, `TASKCLUSTER_ROOT_URL`, `TASKCLUSTER_CLIENT_ID`, and `TASKCLUSTER_ACCESS_TOKEN` environment variables are commonly used.
If your configurations reference `websocktunnel` Docker images by tag, update them to use the `v`-prefixed format (e.g., `image: taskcluster/websocktunnel:v99.0.0`).
Review task payloads that use absolute paths in `mounts` or `artifacts` for Generic Worker. Ensure paths are specified with the expectation that they will be treated as absolute, as the previous behavior of stripping leading path separators is no longer in effect.
Remove `deploymentId` and `checkForNewDeploymentEverySecs` from any Generic Worker configurations. Update any scripts or monitoring systems that rely on Generic Worker's exit code 70 to reflect its new meaning.
pip install taskcluster
from taskcluster import Taskcluster
Set the required environment variables (e.g., `export TASKCLUSTER_ROOT_URL="https://taskcluster.net"`, `export TASKCLUSTER_CLIENT_ID="..."`, `export TASKCLUSTER_ACCESS_TOKEN="..."`) or pass them directly when initializing the client: `tc = Taskcluster(rootUrl="...", clientId="...", accessToken="...")`.
Access the method through its correct namespace, for example: `tc.queue.createTask(...)`.