Skip to content

Unpin Pydantic - #1452

Closed
Olivier Binette (OlivierBinette-UpStart) wants to merge 6 commits into
microsoft:mainfrom
OlivierBinette-UpStart:main
Closed

Unpin Pydantic#1452
Olivier Binette (OlivierBinette-UpStart) wants to merge 6 commits into
microsoft:mainfrom
OlivierBinette-UpStart:main

Conversation

@OlivierBinette-UpStart

Copy link
Copy Markdown

Why are these changes needed?

FLAML currently uses a pinned version of Pydantic, version 1.10.9. This makes it impossible to install FLAML alongside libraries that use other versions of Pydantic or Pydantic v2.

Unclear why that limitation is required. Pydantic is only imported in a single place within the whole of the package.

Changes:

  • I the single import of pydantic to be compatible with both version 1 and version 2.
  • I unpinned the Pydantic version in setup.py.

Checks

@OlivierBinette-UpStart

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="Individual"

@OlivierBinette-UpStart

Copy link
Copy Markdown
Author

Li Jiang (@thinkall) I'm not sure who to ping about this. Could you take a look?

@thinkall Li Jiang (thinkall) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you very much for the PR. LGTM.

@OlivierBinette-UpStart

Copy link
Copy Markdown
Author

Li Jiang (@thinkall) It seems like older versions of ray[tune] are not compatible with pydantic v2. I bumped it to ray[tune]>=2.9 in setup.py, but that might be a more significant dependency change.

@thinkall

Li Jiang (thinkall) commented Aug 5, 2025

Copy link
Copy Markdown
Contributor

Li Jiang (@thinkall) It seems like older versions of ray[tune] are not compatible with pydantic v2. I bumped it to ray[tune]>=2.9 in setup.py, but that might be a more significant dependency change.

Hi Olivier Binette (@OlivierBinette-UpStart) , ray 2 is not tested yet. Let's see will it work.

@thinkall

Li Jiang (thinkall) commented Aug 5, 2025

Copy link
Copy Markdown
Contributor

In fact, pydantic is not pinned in FLAML. If you don't install ray[tune], you're good to go with any pydantic version. autogen module is not updated in FLAML for a long time, if you need autogen, checkout microsoft/autogen repo. Olivier Binette (@OlivierBinette-UpStart)

@OlivierBinette-UpStart

Copy link
Copy Markdown
Author

Li Jiang (@thinkall) Oh you're totally right. We're using ray[tune], which is where the Pydantic dependency must be coming from.

Do you think FLAML can be compatible with newer versions of Ray?

@thinkall

Copy link
Copy Markdown
Contributor

Li Jiang (@thinkall) Oh you're totally right. We're using ray[tune], which is where the Pydantic dependency must be coming from.

Do you think FLAML can be compatible with newer versions of Ray?

The latest PR for supporting ray is #1392, but I'm not sure will it work for other modules or not. I think some changes will be needed.

@thinkall

Copy link
Copy Markdown
Contributor

Pydantic's version is no more limited. Close this PR. Olivier Binette (@OlivierBinette-UpStart) , based on my initial test, ray 2 can work. Any bugs/PRs for better supporting ray 2 is very welcome!

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