-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Migrate models to pydantic 2 #17262
Migrate models to pydantic 2 #17262
Conversation
That's needed so that the new type will be picked up from the default value assignment, as in: ``` def needs_id(id: DecodedDatabaseId =Path(...)) ```
lib/galaxy/schema/drs/openapi.yaml
Outdated
@@ -0,0 +1,1731 @@ | |||
openapi: 3.0.3 |
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.
Does this file need to be included in the repo?
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.
Yeah - expanded diff for the same question 😆.
packages/schema/setup.cfg
Outdated
@@ -31,7 +31,8 @@ version = 23.1.0.dev0 | |||
include_package_data = True | |||
install_requires = | |||
galaxy-util | |||
pydantic[email]<2 | |||
pydantic[email]>=2 | |||
pycryptodome |
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 cannot find where this is used?
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.
It's used for id encoding and decoding via IdEncodingHelper
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.
which I could make a type-only import
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.
which I could make a type-only import
That's probably better, otherwise you'd need to require galaxy-data .
packages/web_apps/setup.cfg
Outdated
@@ -9,6 +9,7 @@ classifiers = | |||
Natural Language :: English | |||
Operating System :: POSIX | |||
Programming Language :: Python :: 3 | |||
Programming Language :: Python :: 3.7 |
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.
There seems to be a number of merge issues with this file, can you please double-check?
scripts/dump_openapi_schema.py
Outdated
AnyUrl, | ||
url_regex, | ||
) | ||
from pydantic.networks import AnyUrl # url_regex, |
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.
Can the commented-out code be removed?
def _hack_fastapi_4428(as_dict) -> RepositoryMetadata: | ||
return RepositoryMetadata(root=as_dict) |
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.
This can probably just be dropped since it's called only in one place?
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.
Good call, thank you!
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.
This is wildly ambitious and I am grateful for our test coverage. Really, really impressive @mvdbeek.
Forgotten in galaxyproject#17262 . Fix broken Update dependencies CI build: https://github.com/galaxyproject/galaxy/actions/runs/7509887325/job/20447594708
Amazing indeed! Thank you so much for taking care of all this 🙏 |
Continuation of #16527 ... sorry for the huge PR, but there's not much one can do incrementally.
How to test the changes?
(Select all options that apply)
License