Metadata-Version: 2.4
Name: pylint-sqlalchemy2
Version: 0.1.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 modern Pylint plugin for SQLAlchemy 2.x compatibility.

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
```

Or install from GitHub:

```bash
pip install git+https://github.com/StefanGentz/pylint-sqlalchemy2.git
```

## Usage

Add the plugin to your `.pylintrc`:

```ini
[MASTER]
load-plugins=pylint_sqlalchemy2
```

Or use it via command line:

```bash
pylint --load-plugins=pylint_sqlalchemy2 your_module.py
```

## 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
from sqlalchemy.orm import Session

# 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.

## 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 focused on SQLAlchemy 2.x compatibility.

## License

MIT License
