Skip to content

Commit

Permalink
Fix mypy type stub packages in pre-commit and pydanticgen (#17)
Browse files Browse the repository at this point in the history
* Fix mypy type stub packages in pre-commit

* Ensure pydantic v2 is installed

* Try different version specifier

* Remove now-defunct parameter in pydantic generation
  • Loading branch information
ml-evs authored Sep 10, 2024
1 parent 6ff7e6c commit cd9af9a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ repos:
hooks:
- id: mypy
name: MyPy
additional_dependencies: [types-all, pydantic~=1.10]
additional_dependencies: [types-PyYAML, pydantic>=2]
2 changes: 1 addition & 1 deletion tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def regenerate_models(_):
for schema in schemas:
print(schema)
schema_path = Path(schema)
gen = pd.PydanticGenerator(schema, pydantic_version="2", verbose=True)
gen = pd.PydanticGenerator(schema, verbose=True)
output = gen.serialize()
with open(MODEL_DIRECTORY / f"{schema_path.name.strip('.yaml')}.py", "w") as f:
f.writelines(output)
Expand Down

0 comments on commit cd9af9a

Please sign in to comment.