-
Notifications
You must be signed in to change notification settings - Fork 3
remove pydantic v1 #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
| - uses: actions/checkout@v2 | ||
| - uses: actions/setup-python@v2 | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python ${{ inputs.python-version }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be matrix instead, don't know why I put inputs in my review on the Beanie repo, probably I saw it in some tutorial so made an unintentional mistake...
| - name: Set up Python ${{ inputs.python-version }} | |
| - name: Set up Python ${{ matrix.python-version }} |
| python-version: ${{ matrix.python-version }} | ||
| - name: Run image | ||
| uses: abatilo/actions-poetry@v2 | ||
| python-version: ${{ inputs.python-version }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as previous comment, otherwise the correct Python version wouldn't be picked up by the CI.
| python-version: ${{ inputs.python-version }} | |
| python-version: ${{ matrix.python-version }} |
.pre-commit-config.yaml
Outdated
| repos: | ||
| - repo: https://github.com/ambv/black | ||
| rev: 22.12.0 | ||
| - repo: https://github.com/charliermarsh/ruff-pre-commit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - repo: https://github.com/charliermarsh/ruff-pre-commit | |
| - repo: https://github.com/astral-sh/ruff-pre-commit |
.pre-commit-config.yaml
Outdated
| - repo: https://github.com/ambv/black | ||
| rev: 22.12.0 | ||
| - repo: https://github.com/charliermarsh/ruff-pre-commit | ||
| rev: v0.11.8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current latest.
| rev: v0.11.8 | |
| rev: v0.11.10 |
| import pydantic_core | ||
| from pydantic import BaseModel, PrivateAttr, ValidationError, TypeAdapter | ||
| from pydantic import BaseModel, PrivateAttr, TypeAdapter, ValidationError | ||
| from pydantic._internal import _fields |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realize this comment is not related to the functionality this PR introduces but, I'm really struggling to see why do we need to import from Pydantic internal stuff.
The only method we use is on ln 76, the is_valid_field_name method and we could simply "vendor it in" ourselves as a helper method.
pyproject.toml
Outdated
| {name = "Roman Right", email = "[email protected]"}, | ||
| ] | ||
| license = {text = "Apache-2.0"} | ||
| requires-python = "<4.0,>=3.9" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would revert this since it reads more naturally to me.
| requires-python = "<4.0,>=3.9" | |
| requires-python = ">=3.9,<4.0" |
pyproject.toml
Outdated
| "mypy>=1.15.0", | ||
| "pytest<8.0.0,>=7.2.0", | ||
| "pytest-cov>=6.1.1", | ||
| "pytest-sugar<2.0.0,>=1.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does this pytest-sugar dependency come from?
Since we don't use it on the Beanie repo I suggest that we don't use it here either.
| "pydantic>=2.10.0,<3.0", | ||
| ] | ||
| name = "lazy-model" | ||
| version = "0.3.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this project doesn't have the same setup as the Beanie project with regards to SemVer uplifts.
Therefore, it is needed to manually update the version specifier when commiting any change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GTM
|
Generally it also looks good to me functionality wise, but the CI testing is broken and my comment for the Warning: Neither 'python-version' nor 'python-version-file' inputs were supplied. Attempting to find '.python-version' file.
Warning: .python-version doesn't exist.
Warning: The `python-version` input is not set. The version of Python currently in `PATH` will be used.It would always select and run the tests with the Python version available from the base image, you can verify this if you check the "run tests" step for each of the tests: Using CPython 3.12.3 interpreter at: /usr/bin/python3 |
4fdd049 to
cae4426
Compare
remove pydantic v1 and migrate to uv