Christophe Bornet
150ac0cb79
core: Add ruff rules DTZ ( #30657 )
...
Add ruff rules DTZ:
https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz
2025-04-04 13:43:47 -04:00
Christophe Bornet
43b5dc7191
core: Add ruff rules TD and FIX ( #30654 )
...
Add ruff rules:
* FIX: https://docs.astral.sh/ruff/rules/#flake8-fixme-fix
* TD: https://docs.astral.sh/ruff/rules/#flake8-todos-td
Code cleanup:
*
[`libs/core/langchain_core/outputs/chat_generation.py`](diffhunk://#diff-a1017ee46f58fa4005b110ffd4f8e1fb08f6a2a11d6ca4c78ff8be641cbb89e5L56-R56):
Removed the "HACK" prefix from a comment in the `set_text` method.
Configuration adjustments:
*
[`libs/core/pyproject.toml`](diffhunk://#diff-06baaee12b22a370fef9f170c9ed13e2727e377d3b32f5018430f4f0a39d3537R85-R93):
Added new rules `FIX002`, `TD002`, and `TD003` to the ignore list.
*
[`libs/core/pyproject.toml`](diffhunk://#diff-06baaee12b22a370fef9f170c9ed13e2727e377d3b32f5018430f4f0a39d3537L102-L108):
Removed the `FIX` and `TD` rules from the ignore list.
Test refinement:
*
[`libs/core/tests/unit_tests/runnables/test_runnable.py`](diffhunk://#diff-06bed920c0dad0cfd41d57a8d9e47a7b56832409649c10151061a791860d5bb5L3231-R3232):
Updated a TODO comment to improve clarity in the `test_map_stream`
function.
2025-04-04 13:40:42 -04:00
Sydney Runkle
32cd70d7d2
release: bump core to v0.3.51
( #30668 )
2025-04-04 13:23:09 +00:00
Christophe Bornet
f241fd5c11
core: Add ruff rules RET ( #29384 )
...
See https://docs.astral.sh/ruff/rules/#flake8-return-ret
All auto-fixes
2025-04-02 16:59:56 -04:00
Eugene Yurtsev
9ae792f56c
core: 0.3.50 release ( #30623 )
...
0.3.50 release
2025-04-02 14:46:23 -04:00
Christophe Bornet
ccc3d32ec8
core: Add ruff rules for Pylint PLC (Convention) and PLE (Errors) ( #29286 )
...
See https://docs.astral.sh/ruff/rules/#pylint-pl
2025-04-02 10:58:03 -04:00
Christophe Bornet
558191198f
core: Add ruff rule FBT003 (boolean-trap) ( #29424 )
...
See
https://docs.astral.sh/ruff/rules/boolean-positional-value-in-call/#boolean-positional-value-in-call-fbt003
This PR also fixes some FBT001/002 in private methods but does not
enforce these rules globally atm.
Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
2025-04-01 17:40:12 +00:00
Christophe Bornet
4f8ea13cea
core: Add ruff rules PERF ( #29375 )
...
See https://docs.astral.sh/ruff/rules/#perflint-perf
2025-04-01 13:34:56 -04:00
Christophe Bornet
8a33402016
core: Add ruff rules PT (pytest) ( #29381 )
...
See https://docs.astral.sh/ruff/rules/#flake8-pytest-style-pt
2025-04-01 13:31:07 -04:00
Christophe Bornet
768e4f695a
core: Add ruff rules S110 and S112 ( #30599 )
2025-04-01 13:17:22 -04:00
Christophe Bornet
88b4233fa1
core: Add ruff rules D (docstring) ( #29406 )
...
This ensures that the code is properly documented:
https://docs.astral.sh/ruff/rules/#pydocstyle-d
Related to #21983
2025-04-01 13:15:45 -04:00
Christophe Bornet
fdda1aaea1
core: Accept ALL ruff rules with exclusions ( #30595 )
...
This pull request updates the `pyproject.toml` configuration file to
modify the linting rules and ignored warnings for the project. The most
important changes include switching to a more comprehensive selection of
linting rules and updating the list of ignored rules to better align
with the project's requirements.
Linting rules update:
* Changed the `select` option to include all available linting rules by
setting it to `["ALL"]`.
Ignored rules update:
* Updated the `ignore` option to include specific rules that interfere
with the formatter, are incompatible with Pydantic, or are temporarily
excluded due to project constraints.
2025-04-01 11:17:51 -04:00
Christophe Bornet
026de908eb
core: Add ruff rules G, FA, INP, AIR and ISC ( #29334 )
...
Fixes mostly for rules G. See
https://docs.astral.sh/ruff/rules/#flake8-logging-format-g
2025-03-31 10:05:23 -04:00
Eugene Yurtsev
d075ad21a0
core[patch]: specify default event loop scope in pyproject.toml ( #30543 )
...
Specify default event loop scope
2025-03-28 19:51:19 +00:00
Christophe Bornet
e181d43214
core: Bump ruff version to 0.11 ( #30519 )
...
Changes are from the new TC006 rule:
https://docs.astral.sh/ruff/rules/runtime-cast-value/
TC006 is auto-fixed.
2025-03-27 13:01:49 -04:00
Christophe Bornet
b28a474e79
core[patch]: Add ruff rules for PLW (Pylint Warnings) ( #29288 )
...
See https://docs.astral.sh/ruff/rules/#warning-w_1
---------
Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
2025-03-27 10:26:12 +00:00
ccurme
9a80be7bb7
core[patch]: release 0.3.49 ( #30500 )
2025-03-26 13:26:32 -04:00
Vadym Barda
7bc50730aa
core[patch]: release 0.3.48 ( #30458 )
2025-03-24 09:48:03 -04:00
ccurme
5588ca4cfb
core: release 0.3.47 ( #30396 )
2025-03-20 18:52:53 +00:00
Vadym Barda
73c04f4707
core[patch]: release 0.3.46 ( #30383 )
2025-03-19 15:09:08 -04:00
ccurme
315bb17ef5
core: release 0.3.45 ( #30277 )
2025-03-13 22:44:23 +00:00
ccurme
cd1ea8e94d
openai[patch]: support Responses API ( #30231 )
...
Co-authored-by: Bagatur <baskaryan@gmail.com>
2025-03-12 12:25:46 -04:00
Vadym Barda
23fa70f328
core[patch]: release 0.3.44 ( #30236 )
2025-03-11 18:59:02 -04:00
ccurme
1c993b921c
core[patch]: release 0.3.43 ( #30173 )
2025-03-07 21:56:00 +00:00
ccurme
4e5058f29c
core[patch]: release 0.3.42 ( #30163 )
2025-03-07 18:14:45 +00:00
ccurme
692a68bf1c
core[patch]: release 0.3.41 ( #30100 )
2025-03-04 15:08:57 +00:00
Christophe Bornet
9e6ffd1264
core: Add ruff rules PTH (pathlib) ( #29338 )
...
See https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth
Co-authored-by: ccurme <chester.curme@gmail.com>
2025-02-28 13:22:20 -05:00
Christophe Bornet
b3885c124f
core: Add ruff rules TC ( #29268 )
...
See https://docs.astral.sh/ruff/rules/#flake8-type-checking-tc
Some fixes done for TC001,TC002 and TC003 but these rules are excluded
since they don't play well with Pydantic.
---------
Co-authored-by: Chester Curme <chester.curme@gmail.com>
2025-02-26 19:39:05 +00:00
Eugene Yurtsev
b525226531
core[patch]: version 0.3.40 ( #29997 )
...
Version 0.3.40 release
2025-02-25 23:09:40 +00:00
ccurme
5437ee385b
core[patch]: release 0.3.39 ( #29966 )
2025-02-24 11:47:01 -05:00
ccurme
0d3a3b99fc
core[patch]: release 0.3.38 ( #29962 )
2025-02-24 15:04:53 +00:00
Christophe Bornet
f6d4fec4d5
core: Add ruff rules ANN (type annotations) ( #29271 )
...
See https://docs.astral.sh/ruff/rules/#flake8-annotations-ann
The interest compared to only mypy is that ruff is very fast at
detecting missing annotations.
ANN101 and ANN102 are deprecated so we ignore them
ANN401 (no Any type) ignored to be in sync with mypy config
---------
Co-authored-by: ccurme <chester.curme@gmail.com>
2025-02-22 17:46:28 -05:00
ccurme
92889edafd
core[patch]: release 0.3.37 ( #29895 )
2025-02-19 20:04:35 +00:00
Eugene Yurtsev
8e5074d82d
core: release 0.3.36 ( #29869 )
...
Release 0.3.36
2025-02-18 19:51:43 +00:00
Christophe Bornet
3dffee3d0b
all: Bump blockbuster version to 1.5.18 ( #29806 )
...
Has fixes for running on Windows and non-CPython runtimes.
2025-02-14 07:55:38 -08:00
ccurme
e61f463745
core[patch]: release 0.3.35 ( #29764 )
2025-02-12 18:13:10 +00:00
ccurme
a91e58bc10
core: release 0.3.34 ( #29644 )
2025-02-06 15:53:56 -05:00
ccurme
d172984c91
infra: migrate to uv ( #29566 )
2025-02-06 13:36:26 -05:00
Christophe Bornet
aab2e42169
core[patch]: Use Blockbuster to detect blocking calls in asyncio during tests ( #29043 )
...
This PR uses the [blockbuster](https://github.com/cbornet/blockbuster )
library in langchain-core to detect blocking calls made in the asyncio
event loop during unit tests.
Avoiding blocking calls is hard as these can be deeply buried in the
code or made in 3rd party libraries.
Blockbuster makes it easier to detect them by raising an exception when
a call is made to a known blocking function (eg: `time.sleep`).
Adding blockbuster allowed to find a blocking call in
`aconfig_with_context` (it ends up calling `get_function_nonlocals`
which loads function code).
**Dependencies:**
- blockbuster (test)
**Twitter handle:** cbornet_
2025-01-31 10:06:34 -05:00
Erick Friis
07e2e80fe7
core: release 0.3.33 ( #29483 )
2025-01-29 14:11:53 -08:00
Erick Friis
8bf9c71673
core: release 0.3.32 ( #29450 )
2025-01-28 07:20:04 +00:00
Christophe Bornet
dbb6b7b103
core: Add ruff rules TRY (tryceratops) ( #29388 )
...
TRY004 ("use TypeError rather than ValueError") existing errors are
marked as ignore to preserve backward compatibility.
LMK if you prefer to fix some of them.
Co-authored-by: Erick Friis <erick@langchain.dev>
2025-01-24 05:01:40 +00:00
Christophe Bornet
e4a78dfc2a
core: Bump ruff version to 0.9 ( #29201 )
...
Also run some preview autofix and formatting
---------
Co-authored-by: Erick Friis <erick@langchain.dev>
2025-01-22 00:20:09 +00:00
Bagatur
923e6fb321
core[patch]: 0.3.31 ( #29320 )
2025-01-21 01:17:31 +00:00
Christophe Bornet
989eec4b7b
core: Add ruff rule S101 (no assert) ( #29267 )
...
Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
2025-01-20 20:24:31 +00:00
Christophe Bornet
e5d62c6ce7
core: Add ruff rule W293 (whitespaces) ( #29272 )
2025-01-20 15:16:12 -05:00
ccurme
d5360b9bd6
core[patch]: release 0.3.30 ( #29256 )
2025-01-16 17:52:37 -05:00
ccurme
8e50e4288c
core[patch]: release 0.3.29 ( #29017 )
2025-01-03 14:58:39 -05:00
Bagatur
1c797ac68f
infra: speed up unit tests ( #28974 )
...
Co-authored-by: Erick Friis <erick@langchain.dev>
2025-01-02 04:13:08 +00:00
ccurme
f0e858b4e3
core[patch]: release 0.3.28 ( #28837 )
2024-12-19 17:52:32 -05:00
Bagatur
557f63c2e6
core[patch]: Release 0.3.27 ( #28799 )
2024-12-18 21:58:03 +00:00
Erick Friis
5cf965004c
core: release 0.3.26 ( #28793 )
2024-12-18 17:28:42 +00:00
Erick Friis
387284c259
core: release 0.3.25 ( #28718 )
2024-12-14 02:22:28 +00:00
Bagatur
1fbd86a155
core[patch]: Release 0.3.24 ( #28656 )
2024-12-10 20:19:21 +00:00
Bagatur
e6a62d8422
core,langchain,community[patch]: allow langsmith 0.2 ( #28598 )
2024-12-10 18:50:58 +00:00
Bagatur
24292c4a31
core[patch]: Release 0.3.23 ( #28648 )
2024-12-10 10:01:16 +00:00
Bagatur
dda9f90047
core[patch]: Release 0.3.22 ( #28582 )
2024-12-06 19:36:53 +00:00
ccurme
f5f1149257
core[patch]: release 0.3.21 ( #28314 )
2024-11-23 12:46:56 +00:00
ccurme
697dda5052
core[patch]: release 0.3.20 ( #28293 )
2024-11-22 14:04:29 -05:00
Erick Friis
6d2004ee7d
multiple: langchain-standard-tests -> langchain-tests ( #28139 )
2024-11-15 11:32:04 -08:00
Erick Friis
d3252b7417
core: release 0.3.19 ( #28137 )
2024-11-15 18:15:28 +00:00
ccurme
f1222739f8
core[patch]: support numpy 2 ( #27991 )
2024-11-14 13:08:57 -05:00
Erick Friis
76e0127539
core: release 0.3.18 ( #28070 )
2024-11-13 16:19:13 +00:00
ccurme
5460096086
core[patch]: release 0.3.17 ( #28060 )
2024-11-12 19:38:56 +00:00
Bagatur
9ebd7ebed8
core[patch]: Release 0.3.16 ( #28045 )
2024-11-12 14:57:15 +00:00
Bagatur
181bcd0577
core[patch]: Release 0.3.15 ( #27802 )
2024-10-31 10:35:02 -07:00
Bagatur
deb4320d29
core[patch]: Release 0.3.14 ( #27764 )
2024-10-30 21:47:33 +00:00
Erick Friis
fbfc6bdade
core: test runner improvements ( #27654 )
...
when running core tests locally this
- prevents langsmith tracing from being enabled by env vars
- prevents network calls
2024-10-25 15:06:59 -07:00
Erick Friis
600b7bdd61
all: test 3.13 ci ( #27197 )
...
Co-authored-by: Bagatur <baskaryan@gmail.com>
Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>
2024-10-25 12:56:58 -07:00
Bagatur
06df15c9c0
core[patch]: Release 0.3.13 ( #27651 )
2024-10-25 19:22:44 +00:00
Erick Friis
265e0a164a
core: add flake8-bandit (S) ruff rules to core ( #27368 )
...
Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
2024-10-24 22:33:41 +00:00
Erick Friis
f9cc9bdcf3
core: release 0.3.12 ( #27410 )
2024-10-17 06:32:40 -07:00
Eugene Yurtsev
202d7f6c4a
core[patch]: 0.3.11 release ( #27403 )
...
Core bump to 0.3.11
2024-10-16 15:39:37 -04:00
Erick Friis
92ae61bcc8
multiple: rely on asyncio_mode auto in tests ( #27200 )
2024-10-15 16:26:38 +00:00
Diao Zihao
4553573acb
core[patch],langchain[patch],community[patch]: Bump version dependency of tenacity to >=8.1.0,!=8.4.0,<10 ( #27201 )
...
This should fixes the compatibility issue with graprag as in
- https://github.com/langchain-ai/langchain/discussions/25595
Here are the release notes for tenacity 9
(https://github.com/jd/tenacity/releases/tag/9.0.0 )
---------
Signed-off-by: Zihao Diao <hi@ericdiao.com>
Co-authored-by: Eugene Yurtsev <eugene@langchain.dev>
Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
2024-10-09 14:00:45 +00:00
Erick Friis
7264fb254c
core: release 0.3.10 ( #27209 )
2024-10-08 16:21:42 -07:00
Christophe Bornet
16f5fdb38b
core: Add various ruff rules ( #26836 )
...
Adds
- ASYNC
- COM
- DJ
- EXE
- FLY
- FURB
- ICN
- INT
- LOG
- NPY
- PD
- Q
- RSE
- SLOT
- T10
- TID
- YTT
Co-authored-by: Erick Friis <erick@langchain.dev>
2024-10-07 22:30:27 +00:00
Christophe Bornet
d31ec8810a
core: Add ruff rules for error messages (EM) ( #26965 )
...
All auto-fixes
Co-authored-by: Erick Friis <erick@langchain.dev>
2024-10-07 22:12:28 +00:00
Bagatur
11df1b2b8d
core[patch]: Release 0.3.9 ( #27117 )
2024-10-04 18:35:33 +00:00
Bagatur
546dc44da5
core[patch]: add UsageMetadata details ( #27072 )
2024-10-03 20:36:17 +00:00
Eugene Yurtsev
635c55c039
core[patch]: Release 0.3.8 ( #27046 )
...
0.3.8 release for core
2024-10-02 16:58:38 +00:00
Bagatur
34bd718fe1
core[patch]: Release 0.3.7 ( #27004 )
2024-09-30 18:52:42 +00:00
Christophe Bornet
db8845a62a
core: Add ruff rules for pycodestyle Warning (W) ( #26964 )
...
All auto-fixes.
2024-09-30 09:31:43 -04:00
Christophe Bornet
7809b31b95
core[patch]: Add ruff rules for flake8-simplify (SIM) ( #26848 )
...
Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
2024-09-27 20:13:23 +00:00
Christophe Bornet
f4e738bb40
core: Add ruff rules for PIE ( #26939 )
...
All auto-fixes.
2024-09-27 12:08:35 -04:00
Erick Friis
ef2ab26113
core: release 0.3.6 ( #26863 )
2024-09-25 11:05:53 -07:00
Christophe Bornet
3a1b9259a7
core: Add ruff rules for comprehensions (C4) ( #26829 )
2024-09-25 09:34:17 -04:00
Erick Friis
238a31bbd9
core: release 0.3.5 ( #26737 )
2024-09-21 00:26:39 +00:00
Erick Friis
4a2745064a
core: release 0.3.4 ( #26729 )
2024-09-20 14:47:15 -07:00
Erick Friis
465e43cd43
core: release 0.3.3 ( #26713 )
2024-09-20 13:54:19 -07:00
William FH
19ce95d3c9
Avoid copying runs ( #26689 )
...
Also, re-unify run trees. Use a single shared client.
2024-09-20 10:57:41 -07:00
Bagatur
c453b76579
core[patch]: Release 0.3.2 ( #26686 )
2024-09-19 14:58:45 -07:00
Christophe Bornet
fd21ffe293
core: Add N(naming) ruff rules ( #25362 )
...
Public classes/functions are not renamed and rule is ignored for them.
Co-authored-by: Erick Friis <erick@langchain.dev>
2024-09-19 05:09:39 +00:00
Erick Friis
9909354cd0
core: use ruff.target-version instead ( #26634 )
...
tested on one of the replacement cases and seems to work!

2024-09-18 21:06:14 +00:00
Erick Friis
84b831356c
core: remove [project] tag from pyproject ( #26633 )
...
makes core incompatible with uv installs
2024-09-18 20:39:49 +00:00
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
Christophe Bornet
3a99467ccb
core[patch]: Add ruff rule UP006(use PEP585 annotations) ( #26574 )
...
* Added rules `UPD006` now that Pydantic is v2+
---------
Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
2024-09-17 21:22:50 +00:00
Bagatur
145a49cca2
core[patch]: Release 0.3.1 ( #26581 )
2024-09-17 17:34:09 +00:00
Erick Friis
d46ab19954
core: release 0.3.0 ( #26453 )
2024-09-13 21:45:45 +00:00
Erick Friis
c2a3021bb0
multiple: pydantic 2 compatibility, v0.3 ( #26443 )
...
Signed-off-by: ChengZi <chen.zhang@zilliz.com>
Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>
Co-authored-by: Dan O'Donovan <dan.odonovan@gmail.com>
Co-authored-by: Tom Daniel Grande <tomdgrande@gmail.com>
Co-authored-by: Grande <Tom.Daniel.Grande@statsbygg.no>
Co-authored-by: Bagatur <baskaryan@gmail.com>
Co-authored-by: ccurme <chester.curme@gmail.com>
Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
Co-authored-by: Tomaz Bratanic <bratanic.tomaz@gmail.com>
Co-authored-by: ZhangShenao <15201440436@163.com>
Co-authored-by: Friso H. Kingma <fhkingma@gmail.com>
Co-authored-by: ChengZi <chen.zhang@zilliz.com>
Co-authored-by: Nuno Campos <nuno@langchain.dev>
Co-authored-by: Morgante Pell <morgantep@google.com>
2024-09-13 14:38:45 -07:00