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

Bug: bump_pydantic convert constr v1 regex to v2 pattern #80

Closed
1 task done
schlitzered opened this issue Jul 11, 2023 · 2 comments · Fixed by #90
Closed
1 task done

Bug: bump_pydantic convert constr v1 regex to v2 pattern #80

schlitzered opened this issue Jul 11, 2023 · 2 comments · Fixed by #90
Assignees

Comments

@schlitzered
Copy link

schlitzered commented Jul 11, 2023

Initial Checks

  • I confirm that I'm using Pydantic V2

Description

bump_pydantic script should convert constr "regex" to "pattern"

i ran the bump_pydantic on my code base, and it did not convert anything, it seems it should at least convert constr(regex='') to constr(pattern='')

i am not sure if there is other stuff that bump_pydantic is missing,

Example Code

import pydantic

KUBE_SAVE_STR_30 = pydantic.constr(pattern="^(?![0-9]+$)(?!-)[a-z0-9-]{,30}(?<!-)$")

Python, Pydantic & OS Version

python 3.9

(venv) [sschultchen@sschultchen2pc common_Argocd]$ pip freeze
annotated-types==0.5.0
bump-pydantic==0.3.0
certifi==2023.5.7
charset-normalizer==3.1.0
click==8.1.4
idna==3.4
libcst==1.0.1
markdown-it-py==3.0.0
mdurl==0.1.2
mypy==1.4.1
mypy-extensions==1.0.0
pydantic==2.0.2
pydantic_core==2.1.2
Pygments==2.15.1
PyYAML==6.0
requests==2.31.0
rich==13.4.2
typer==0.9.0
typing-inspect==0.9.0
typing_extensions==4.6.3
urllib3==2.0.3

Selected Assignee: @adriangb

@Kludex Kludex transferred this issue from pydantic/pydantic Jul 11, 2023
@adriangb adriangb assigned Kludex and unassigned adriangb Jul 11, 2023
@adriangb
Copy link
Member

@Kludex assigning this to you

@Kludex
Copy link
Member

Kludex commented Jul 11, 2023

Yeap, I've already transferred to bump-pydantic. 🙏

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 a pull request may close this issue.

3 participants