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

fix: Require Pydantic 1.10.2 when Python is 3.11 #279

Merged
merged 1 commit into from
Oct 24, 2022

Conversation

tombh
Copy link
Collaborator

@tombh tombh commented Oct 24, 2022

This finally gives us Python 3.11 support.

See #234 for more discussion.

  • Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR)
  • Title summarizes what is changing
  • Commit messages are meaningful (see [this][commit messages] for details)
  • Tests have been included and/or updated, as appropriate
  • Docstrings have been included and/or updated, as appropriate
  • Standalone docs have been updated accordingly
    - [ ] [CONTRIBUTORS.md][contributors] was updated, as appropriate
  • Changelog has been updated, as needed (see [CHANGELOG.md][changelog])

@tombh tombh merged commit 00790cb into master Oct 24, 2022
@brettcannon
Copy link
Contributor

If I'm reading this correctly, there is no single version of Pydantic that pygls can use which is compatible with all supported versions of Python? It looks like you have it set so that Python 3.10 and older use Pydantic 1.9.1 or 1.9.2, while Python 3.11 is 1.10 or newer. Is Pydantic 1.10 not usable for Python 3.7 - 3.10?

@brettcannon
Copy link
Contributor

Or put another way, upper bounds on dependencies is typically considered bad practice for libraries. I can find you a blog post reference if you want all the gory details.

@tombh
Copy link
Collaborator Author

tombh commented Oct 24, 2022

I fully agree it's bad practice. The main excuse is that we are close to releasing a major version bump that completely removes Pydantic: #273. It certainly may be possible to release Pygls with a single version of pydantic==1.10.2, but Pydantic v1.10.0 introduced breaking changes (doing so on minor version increments is itself generally argued as bad practice right?). Considering those points and the immanent release of Python 3.11 (which simply did not work at all before this PR), it seems better to just, hopefully temporarily, manage with this working, albeit bad practice, solution.

I'm curious if those points didn't come across clearly in #234? If I misunderstood something or moved too hastily, it'd be good to know. At the very least I would hope that Pygls isn't adding more unnecessary inconveniences of bad practice to the ecosystem.

@brettcannon
Copy link
Contributor

The main excuse is that we are close to releasing a major version bump that completely removes Pydantic: #273.

Right, but you haven't released it yet and it seems far out enough you are making this fix. 😉 If you weren't bothering with the fix I would understand, but if you are then folks like us are going to take this fixed release and bump up against issues if you install a single version of pygls to service multiple versions of Python (e.g. we install a copy copy of pygls for our Black formatter extension in VS Code that needs to work across Python 3.7 - 3.11; this PR technically means we can't get a version of pydantic in there that meets that criteria with pygls).

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.

5 participants