Skip to content

deps: rm pydantic uppper version bound#725

Closed
5tefan wants to merge 2 commits intopyupio:mainfrom
5tefan:stefan/remove-upper-pydantic-bound
Closed

deps: rm pydantic uppper version bound#725
5tefan wants to merge 2 commits intopyupio:mainfrom
5tefan:stefan/remove-upper-pydantic-bound

Conversation

@5tefan
Copy link

@5tefan 5tefan commented Apr 28, 2025

Description

Remove upper version bound for Pydantic.

There are no less than 7 +1s about this in #673.

No background in #655 (refs #620) on why the upper bound on pydantic was put in place. Removed.

There were some deprecation warnings... I resolved the pydantic_encoder one. Trying to fix the config one seems to break safety_schemas. I'll let you all handle that one :)

class Config:
arbitrary_types_allowed: bool = True
max_anystr_length: int = 50
validate_assignment: bool = True
extra = Extra.forbid

PydanticDeprecatedSince20: Support for class-based `config` is deprecated, use ConfigDict instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.9/migration/
    warnings.warn(DEPRECATION_MESSAGE, DeprecationWarning)

DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
    import pkg_resources

tests/test_cli.py: 1 warning
tests/test_safety.py: 9 warnings
`pydantic_encoder` is deprecated, use `pydantic_core.to_jsonable_python` instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.9/migration/
    return _iterencode(o, 0)

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor
  • Other (please describe): dependency version

Related Issues

Fixes #673

Testing

  • Tests added or updated
  • No tests required

Ran pytest.

Checklist

  • Code is well-documented
  • Changelog is updated (if needed)
  • No sensitive information (e.g., keys, credentials) is included in the code
  • All PR feedback is addressed

Additional Notes

@coderabbitai
Copy link

coderabbitai bot commented Apr 28, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@sr-verde
Copy link

Thanks, I hope that this PR will be merged soon.

@yeisonvargasf
Copy link
Member

We appreciate this PR and are working on supporting Pydantic without any upper constraint. First, we need to remove that constraint from one of our dependencies.

We are close to addressing this issue without breaking changes.

@sr-verde
Copy link

Hey, it’s a pain with version restrictions in safety currently. This MR is open since end of April. The corresponding issue is open since February. What’s needed to get that into a release?

@andytriboletti
Copy link

We appreciate this PR and are working on supporting Pydantic without any upper constraint. First, we need to remove that constraint from one of our dependencies.

We are close to addressing this issue without breaking changes.

When do you think it will be ready? I'd like to re-enable safety.

@Guts
Copy link

Guts commented Sep 2, 2025

Thanks @5tefan for providing this PR to solve the blocking issue. Well, looking at the recent dependencies relax changes by @yeisonvargasf in #775 and #776, I get some hope to see it quickly merged.

@yeisonvargasf
Copy link
Member

Thank you for your patience and for contributing this PR. We truly appreciate the community's engagement on this issue, and I apologize for the delay in moving forward with this important change.

I'm pleased to confirm that we can now proceed with this PR. The dependency issue that was previously blocking our progress has been resolved.

Next steps will be:

  1. Rebase this PR against the latest main branch
  2. Review the test run output to ensure all parties are satisfied with the changes
  3. Merge the PR
  4. Release a patch version

Thank you again for your contribution and your patience throughout this process.

@yeisonvargasf
Copy link
Member

Hi @5tefan,

Thanks again for your contribution and the work you put into this PR. Since it's been a couple of weeks since the last activity and we haven't heard back regarding the rebase, we've opened a new PR (#793) incorporating your changes.

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.

Migrate to Pydantic > 2.10

5 participants