Skip to content
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

Fix a typo in the DeprecationWarning warning of _VersionPydanticAnnotation #289

Closed
wants to merge 3 commits into from

Conversation

urasakikeisuke
Copy link

This PR fixes a typo in the deprecation warning message of _VersionPydanticAnnotation.

@@ -13,7 +13,8 @@
from typing_extensions import Annotated

warnings.warn(
'Use from pydantic_extra_types.semver import SemanticVersion instead. Will be removed in 3.0.0.', DeprecationWarning
'Use from pydantic_extra_types.semantic_version import SemanticVersion instead. Will be removed in 3.0.0.',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @urasakikeisuke the file name is semver so changing this pydantic_extra_types.semantic_version require changing the name of the file

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @yezz123! The guidance in the warning “from pydantic_extra_types.semver import SemanticVersion” led to the following ImportError.

>>> from pydantic_extra_types.semver import SemanticVersion
Traceback (most recent call last):
  File "<python-input-0>", line 1, in <module>
    from pydantic_extra_types.semver import SemanticVersion
ImportError: cannot import name 'SemanticVersion' from 'pydantic_extra_types.semver' (/home/user/.venv/lib/python3.13/site-packages/pydantic_extra_types/semver.py)

When I imported as follows, the error did not occur.

>>> from pydantic_extra_types.semantic_version import SemanticVersion
>>> 

The SemanticVersion class is in semantic_version.py so the change is fine I think.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you miss changing the files here is the file you should update https://github.com/urasakikeisuke/pydantic-extra-types/blob/main/pydantic_extra_types/semantic_version.py

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is my take here, we can merge both of them because they are duplicated logic and we can keep one of them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants