Metadata-Version: 2.4
Name: pylint-sqlalchemy2
Version: 0.2.0
Summary: Pylint plugin for SQLAlchemy 2.x compatibility - fixes false positives for func.count(), func.sum(), etc.
Project-URL: Homepage, https://github.com/StefanGentz/pylint-sqlalchemy2
Project-URL: Repository, https://github.com/StefanGentz/pylint-sqlalchemy2
Project-URL: Issues, https://github.com/StefanGentz/pylint-sqlalchemy2/issues
Author-email: Stefan Gentz <github@stefan-gentz.com>
License-Expression: MIT
License-File: LICENSE
Keywords: linter,plugin,pylint,sqlalchemy,static-analysis
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.9
Requires-Dist: astroid>=3.0
Requires-Dist: pylint>=3.0
Provides-Extra: dev
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Description-Content-Type: text/markdown

# pylint-sqlalchemy2

A Pylint plugin for SQLAlchemy 2.x compatibility. **Install and forget!**

Fixes false positive errors when using Pylint with SQLAlchemy, particularly for dynamically generated SQL functions like `func.count()`, `func.sum()`, `func.max()`, etc.

## Installation

```bash
pip install pylint-sqlalchemy2
```

**That's it!** The plugin activates automatically. No configuration needed.

## What it fixes

### E1102: not-callable for `func.*`

SQLAlchemy's `func` object dynamically generates SQL function calls. Pylint cannot analyze this and reports false positives:

```python
from sqlalchemy import func, select

# Without this plugin, pylint reports:
# E1102: func.count is not callable (not-callable)
query = select(func.count()).select_from(User)
```

This plugin teaches Pylint that `func.count()`, `func.sum()`, `func.max()`, and all other `func.*` attributes are callable.

## How it works

The plugin uses a `.pth` file to automatically register Astroid transforms when Python starts. This means it works without any configuration - just install and run pylint as usual.

## Alternative usage

If you prefer explicit configuration, you can also use:

**Command line:**
```bash
pylint --load-plugins=pylint_sqlalchemy2 your_code.py
```

**pylintrc or pyproject.toml:**
```ini
[MASTER]
load-plugins=pylint_sqlalchemy2
```

## Compatibility

- Python 3.9+
- Pylint 3.0+
- Astroid 3.0+
- SQLAlchemy 1.4+ / 2.x

## Why not pylint-sqlalchemy?

The original [pylint-sqlalchemy](https://github.com/gwax/pylint-sqlalchemy) package is deprecated and doesn't handle `func.*` callable issues. This plugin is a modern replacement with automatic activation.

## License

MIT License
