use graphql's built-in version object#3622
use graphql's built-in version object#3622patrick91 merged 4 commits intostrawberry-graphql:mainfrom
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3622 +/- ##
==========================================
- Coverage 96.77% 96.75% -0.02%
==========================================
Files 521 521
Lines 33731 33715 -16
Branches 5627 5622 -5
==========================================
- Hits 32643 32622 -21
- Misses 856 861 +5
Partials 232 232 |
| from packaging.version import Version | ||
| from graphql.version import VersionInfo, version_info | ||
|
|
||
| IS_GQL_33 = Version(graphql.__version__) >= Version("3.3.0a") | ||
| IS_GQL_33 = version_info >= VersionInfo.from_str("3.3.0a0") |
There was a problem hiding this comment.
Ah nice! I think I like this more 😊
assuming graphql core will keep exporting VersionInfo :D
There was a problem hiding this comment.
Sure, always a concern. But given the tightness of the pin, it seems unlikely this project would be caught unaware.
There was a problem hiding this comment.
yup, I'd say let's merge this :)
can you add a RELEASE.md file?
release type: patch
This release updates how we check for GraphQL core's version to remove a dependency on the `packaging` package
something like this 😊
CodSpeed Performance ReportMerging #3622 will not alter performanceComparing Summary
|
Reviewer's Guide by SourceryThis pull request updates the version checking mechanism for GraphQL in the Strawberry project. It replaces the use of the File-Level Changes
Tips
|
There was a problem hiding this comment.
Hey @bollwyvl - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟡 Documentation: 2 issues found
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
|
Thanks for adding the Here's a preview of the changelog: This release updates how we check for GraphQL core's version to remove a Here's the tweet text: |
|
Thanks for contributing to Strawberry! 🎉 You've been invited to join You can also request a free sticker by filling this form: https://forms.gle/dmnfQUPoY5gZbVT67 And don't forget to join our discord server: https://strawberry.rocks/discord 🔥 |

Description
Alternative to to #3621.
Uses
graphql.version.VersionInfoinstead ofpackagingto do version sniffing instead ofpackaging(or evenimportlib.metadata.version, as that only provides strings).That API has been there for five years, certainly above the current minimum dependency.
Types of Changes
Issues Fixed or Closed by This PR
Checklist
Summary by Sourcery
Use GraphQL's built-in
VersionInfofor version checking instead of thepackaginglibrary, simplifying dependencies and ensuring compatibility with GraphQL core.Bug Fixes:
packaginglibrary withgraphql.version.VersionInfofor version checking, ensuring compatibility with GraphQL core's built-in version object.Chores:
RELEASE.mdfile to document the release type as a patch and note the update in version checking.