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

Support pydantic v2 #360

Closed
gbdlin opened this issue Aug 29, 2023 · 4 comments · Fixed by #364
Closed

Support pydantic v2 #360

gbdlin opened this issue Aug 29, 2023 · 4 comments · Fixed by #364
Labels
P2 major: an upcoming release

Comments

@gbdlin
Copy link

gbdlin commented Aug 29, 2023

Describe the bug
Right now FawltyDeps requires pydantic v1, which conflicts with projects using pydantic v2.

To Reproduce

  1. create a project that requires pydantic v2 (for example 2.3.0)
  2. Add FawltyDeps for the project
  3. Observe dependency conflict resolution or errors thrown either by the project or by Fawlty deps due to wrong pydantic version being installed

Expected behavior
FawltyDeps should support both v1 and v2 versions of Pydantic, or at some point, fully migrate to v2.

Alternatively, FalwltyDeps can have pydantic vendored, so it doesn't conflict with any project it is used in.

Environment

  • OS name + version: Any
  • Version of the code: v0.13.0

Additional context
Pydantic v2 was released a while ago and is already popular as it introduces a performance boost and a lot of new features.

@Nour-Mws
Copy link
Collaborator

Hi @gbdlin, thanks for reporting! We'll look into this and let you know.

@jherland jherland added the P2 major: an upcoming release label Aug 29, 2023
@jherland
Copy link
Member

https://docs.pydantic.dev/latest/migration/ will be helpful while completing this.

@Nour-Mws
Copy link
Collaborator

Until this is sorted out, @gbdlin, can you tell us more on how you use FawltyDeps?

If it's purely used to check dependencies (in CI for example), it's possible to run it in its own virtual environment. The last release (0.13.0) supports a wide range of ways to resolve your project's dependencies without necessarily needing FawltyDeps to be installed in the same environment as your project.

You can, for example, point FawltyDeps at the venv used in your project with fawltydeps --pyenv /path/to/project/venv.
Or better yet, if the venv is under your project's directory, FawltyDeps should be able to automatically detect virtual environments (in linux, we don't yet support automatic discovery in windows).
To see all the ways you have available to you for resolving dependencies, please check the documentation on resolving dependencies.

@gbdlin
Copy link
Author

gbdlin commented Sep 2, 2023

Unfortunately, running it outside the project env would require a major refactor of project's dockerfile an CI.

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

Successfully merging a pull request may close this issue.

3 participants