{"id":4792,"library":"taskcluster","title":"Python client for Taskcluster","description":"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.","status":"active","version":"99.0.3","language":"en","source_language":"en","source_url":"https://github.com/taskcluster/taskcluster","tags":["CI/CD","automation","build system","testing","async","synchronous"],"install":[{"cmd":"pip install taskcluster","lang":"bash","label":"Install stable release"}],"dependencies":[{"reason":"Requires Python 3.9 or newer.","package":"python","optional":false}],"imports":[{"symbol":"taskcluster","correct":"import taskcluster"},{"note":"For asynchronous API clients.","symbol":"taskcluster.aio","correct":"import taskcluster.aio"},{"note":"Client classes like `Queue`, `Auth`, `Index` are directly under `taskcluster` (sync) or `taskcluster.aio` (async) namespaces. The `taskcluster.client` module is not the intended public interface.","wrong":"from taskcluster.client import Queue","symbol":"Queue","correct":"from taskcluster import Queue"}],"quickstart":{"code":"import os\nimport taskcluster\n\n# Configure client using environment variables (recommended)\noptions = taskcluster.optionsFromEnvironment()\n\n# Alternatively, explicit configuration\n# options = {\n#     'rootUrl': 'https://taskcluster.example.com',\n#     'credentials': {\n#         'clientId': os.environ.get('TASKCLUSTER_CLIENT_ID', 'your-client-id'),\n#         'accessToken': os.environ.get('TASKCLUSTER_ACCESS_TOKEN', 'your-access-token')\n#     }\n# }\n\n# Create a synchronous client for the Queue service\nqueue = taskcluster.Queue(options)\n\n# Example: List tasks (requires appropriate scopes and a running Taskcluster instance)\ntry:\n    # This is a simplified example; actual API calls vary.\n    # For a real listing, you'd likely use `listTasks` with filters.\n    # We'll just try to get a service status as a quick test.\n    status = queue.status()\n    print(f\"Taskcluster Queue Service Status: {status['state']}\")\nexcept Exception as e:\n    print(f\"Could not connect to Taskcluster or fetch status: {e}\")\n    print(\"Ensure TASKCLUSTER_ROOT_URL and credentials are set if required.\")\n\n# For asynchronous operations, use the aio client:\n# import asyncio\n# async def main():\n#     aio_queue = taskcluster.aio.Queue(options)\n#     status = await aio_queue.status()\n#     print(f\"Async Queue Service Status: {status['state']}\")\n# asyncio.run(main())","lang":"python","description":"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."},"warnings":[{"fix":"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`).","message":"The Docker image tags for `taskcluster/websocktunnel` now require a `v` prefix (e.g., `v99.0.0` instead of `99.0.0`).","severity":"breaking","affected_versions":">=99.0.0"},{"fix":"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.","message":"Generic Worker now correctly evaluates absolute paths specified in `mounts` (properties `directory` and `file`) and `artifacts` (property `path`) within task payloads. Previously, these were treated as relative paths.","severity":"breaking","affected_versions":">=98.0.0"},{"fix":"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.","message":"The Generic Worker configuration properties `deploymentId` and `checkForNewDeploymentEverySecs` are no longer supported and must be removed from configurations. Additionally, Generic Worker exit code 70 now signifies 'Worker Manager advised termination' instead of 'non-current deployment ID'.","severity":"breaking","affected_versions":">=98.0.0"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}