langchain/libs/core/langchain_core/callbacks
Christophe Bornet a47b332841
core: Put Python version as a project requirement so it is considered by ruff (#26608)
Ruff doesn't know about the python version in
`[tool.poetry.dependencies]`. It can get it from
`project.requires-python`.

Notes:
* poetry seems to have issues getting the python constraints from
`requires-python` and using `python` in per dependency constraints. So I
had to duplicate the info. I will open an issue on poetry.
* `inspect.isclass()` doesn't work correctly with `GenericAlias`
(`list[...]`, `dict[..., ...]`) on Python <3.11 so I added some `not
isinstance(type, GenericAlias)` checks:

Python 3.11
```pycon
>>> import inspect
>>> inspect.isclass(list)
True
>>> inspect.isclass(list[str])
False
```

Python 3.9
```pycon
>>> import inspect
>>> inspect.isclass(list)
True
>>> inspect.isclass(list[str])
True
```

Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
2024-09-18 14:37:57 +00:00
..
__init__.py core[minor]: Add dispatching for custom events (#24080) 2024-07-11 02:25:12 +00:00
base.py core: Put Python version as a project requirement so it is considered by ruff (#26608) 2024-09-18 14:37:57 +00:00
file.py core[patch]: Add ruff rule UP006(use PEP585 annotations) (#26574) 2024-09-17 21:22:50 +00:00
manager.py core: Put Python version as a project requirement so it is considered by ruff (#26608) 2024-09-18 14:37:57 +00:00
stdout.py core[patch]: Add ruff rule UP006(use PEP585 annotations) (#26574) 2024-09-17 21:22:50 +00:00
streaming_stdout.py core[patch]: Add ruff rule UP006(use PEP585 annotations) (#26574) 2024-09-17 21:22:50 +00:00