{"id":6805,"library":"pylint-celery","title":"Pylint Celery Plugin","description":"pylint-celery is a Pylint plugin designed to enhance Pylint's ability to recognize and understand common patterns and potential errors when analyzing code that uses the Celery distributed task queue library. It aims to reduce false positives and provide more accurate linting for Celery-specific constructs. The current version is 0.3, with the last PyPI release dating back to 2014, suggesting a low-cadence, maintenance-focused development cycle, though the GitHub repository under pylint-dev sees ongoing issue tracking.","status":"maintenance","version":"0.3","language":"en","source_language":"en","source_url":"https://github.com/pylint-dev/pylint-celery","tags":["pylint","celery","linter","plugin","code quality"],"install":[{"cmd":"pip install pylint-celery","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Core linter framework; pylint-celery is a plugin for it.","package":"pylint"},{"reason":"The library being linted; pylint-celery provides Celery-specific checks.","package":"celery"},{"reason":"Utility library for developing Pylint plugins, often a dependency for Pylint plugins.","package":"pylint-plugin-utils"}],"imports":[{"note":"This is a Pylint plugin and is loaded via the Pylint command-line argument, not imported directly in Python code.","symbol":"pylint_celery","correct":"pylint --load-plugins pylint_celery"}],"quickstart":{"code":"# 1. Install pylint-celery\npip install pylint-celery\n\n# 2. Create a dummy Celery task file (e.g., myapp/tasks.py)\n# Ensure Celery and Pylint are in your environment\n# Example: myapp/tasks.py\n# from celery import Celery\n#\n# app = Celery('myapp', broker='redis://localhost:6379/0')\n#\n# @app.task\n# def add(x, y):\n#     return x + y\n\n# 3. Run Pylint with the plugin loaded\n# Navigate to your project root or where your code resides\npylint --load-plugins pylint_celery myapp/tasks.py","lang":"bash","description":"After installing the plugin, you enable it by passing `--load-plugins pylint_celery` to your Pylint command. This integrates its checks into the linting process for your Celery-based code."},"warnings":[{"fix":"While `pylint-celery` itself would need an update to add `pyproject.toml`, users can ensure the `wheel` package is installed to mitigate some pip warnings, or be aware of the legacy installation method.","message":"The project lacks a `pyproject.toml` file, leading to a `DEPRECATION` warning when installed using newer `pip` versions, as it defaults to the legacy `setup.py install` method.","severity":"gotcha","affected_versions":"0.3 and possibly earlier versions, with pip >= 23.1"},{"fix":"Refer to the `pylint-celery` GitHub issues for recent compatibility reports or consider pinning Pylint to an older, compatible version if issues arise.","message":"Pylint-celery's compatibility with newer Pylint versions is uncertain. An old issue (2017) indicated test failures with Pylint 1.7+. Users may encounter unexpected warnings or errors if using `pylint-celery` with significantly newer Pylint versions without official updates.","severity":"gotcha","affected_versions":"Potentially all versions of `pylint-celery` with Pylint > 1.7"},{"fix":"Ensure Pylint is run within the activated virtual environment containing Celery. If issues persist, configure Pylint's `init-hook` or `sys-path` in `.pylintrc` or `pyproject.toml` to include necessary paths.","message":"Pylint (even with the plugin) can sometimes fail to resolve Celery imports (e.g., `E0401: Unable to import 'celery'`) if the Python environment or `PYTHONPATH` is not correctly configured or the virtual environment is not properly activated when running Pylint.","severity":"gotcha","affected_versions":"All versions"},{"fix":"If `E1120` or similar warnings persist for valid `bind=True` tasks, consider explicitly disabling the `no-value-for-parameter` message for the affected lines or files using `# pylint: disable=no-value-for-parameter`.","message":"The plugin's primary role is to fix 'celery.task is not callable' warnings. However, Pylint might still issue `E1120: No value for argument 'self'` for `bind=True` Celery tasks if the plugin doesn't fully cover specific class-based task definitions or complex scenarios, requiring manual disables.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}