Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit c1884bd

Browse files
AnasHasan786Lee-W
authored andcommitted
docs(faq): explain why Pydantic is not used
1 parent 195ed16 commit c1884bd

File tree

3 files changed

+65
-18
lines changed

3 files changed

+65
-18
lines changed

docs/faq.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,20 @@ git revert --no-commit <SHA>
8282
git commit -m "revert: foo bar"
8383
```
8484

85+
## Why don't we use Pydantic?
86+
87+
While Pydantic is a powerful and popular library for data validation, we intentionally avoid using it in this project to keep our dependency tree minimal and maintainable.
88+
89+
Including Pydantic would increase the chances of version conflicts for users - especially with major changes introduced in Pydantic v3. Because we pin dependencies tightly, adding Pydantic could unintentionally restrict what other tools or libraries users can install alongside `commitizen`.
90+
91+
Moreover we don't rely on the full feature set of Pydantic. Simpler alternatives like Python's built-in `TypedDict` offer sufficient type safety for our use cases, without the runtime overhead or dependency burden.
92+
93+
In short, avoiding Pydantic helps us:
94+
- Keep dependencies lightweight
95+
- Reduce compatibility issues for users
96+
- Maintain clarity about what contributors should and shouldn't use
97+
98+
8599
## I got `Exception [WinError 995] The I/O operation ...` error
86100

87101
This error was caused by a Python bug on Windows. It's been fixed by [this PR](https://github.com/python/cpython/pull/22017), and according to Python's changelog, [3.8.6rc1](https://docs.python.org/3.8/whatsnew/changelog.html#python-3-8-6-release-candidate-1) and [3.9.0rc2](https://docs.python.org/3.9/whatsnew/changelog.html#python-3-9-0-release-candidate-2) should be the accurate versions first contain this fix. In conclusion, upgrade your Python version might solve this issue.

poetry.lock

Lines changed: 50 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ packages = [{ include = "commitizen" }, { include = "commitizen/py.typed" }]
107107
[tool.poetry.group.dev.dependencies]
108108
ipython = "^8.0"
109109
tox = ">4"
110+
poethepoet = "^0.34.0"
110111

111112
[tool.poetry.group.test.dependencies]
112113
pytest = ">=7.2,<9.0"

0 commit comments

Comments
 (0)