llnl / llnl/OGhidra

Migrate to Pydantic V2.

Open
#28 0 comments 0 reactions 1 assignee Claimed by @moonjck View on GitHub
Dominant language
Python
Stars
440
Forks
48
Avg merge
28m
Merged PRs (30d)
1

Description

Much of the Pydantic code is deprecated and we should move to Pydantic V2. There are hundreds of deprecation warnings in the code like these:

```
src\config.py:1413
c:\!dev\BitBunker\ghidra-kasm\OGhidra\src\config.py:1413: PydanticDeprecatedSince20: Using extra keyword arguments on `Field` is deprecated and will be removed. Use `json_schema_extra` instead. (Extra keys: 'env'). Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.13/migration/
llm_provider: str = Field(

src\config.py:1442
c:\!dev\BitBunker\ghidra-kasm\OGhidra\src\config.py:1442: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.13/migration/
@validator("log_level")

src\config.py:1451
c:\!dev\BitBunker\ghidra-kasm\OGhidra\src\config.py:1451: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.13/migration/
@validator("log_file")

src\config.py:1460
c:\!dev\BitBunker\ghidra-kasm\OGhidra\src\config.py:1460: PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.13/migration/
@validator("knowledge_base_dir")

src\models\memory.py:33
c:\!dev\BitBunker\ghidra-kasm\OGhidra\src\models\memory.py:33: PydanticDeprecatedSince20: Support for class-based `config` is deprecated, use ConfigDict instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.13/migration/
class ConversationMessage(BaseModel):

src\models\memory.py:91
c:\!dev\BitBunker\ghidra-kasm\OGhidra\src\models\memory.py:91: PydanticDeprecatedSince20: Support for class-based `config` is deprecated, use ConfigDict instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.13/migration/
class AnalysisState(BaseModel):

src\models\memory.py:160
c:\!dev\BitBunker\ghidra-kasm\OGhidra\src\models\memory.py:160: PydanticDeprecatedSince20: Support for class-based `config` is deprecated, use ConfigDict instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.13/migration/
class PromptSection(BaseModel):
```

The migration is pretty straightforward even for a agentic tool to do.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.