strawberry icon indicating copy to clipboard operation
strawberry copied to clipboard

Run tests on 3.14

Open patrick91 opened this issue 8 months ago • 3 comments

Description

Types of Changes

  • [ ] Core
  • [ ] Bugfix
  • [ ] New feature
  • [ ] Enhancement/optimization
  • [ ] Documentation

Issues Fixed or Closed by This PR

Checklist

  • [ ] My code follows the code style of this project.
  • [ ] My change requires a change to the documentation.
  • [ ] I have updated the documentation accordingly.
  • [ ] I have read the CONTRIBUTING document.
  • [ ] I have added tests to cover my changes.
  • [ ] I have tested the changes and verified that they work and don't break anything (as well as I can manage).

Summary by Sourcery

Add support for Python 3.14 in test matrix and noxfile configuration

CI:

  • Update GitHub Actions workflow to include Python 3.14-dev test session

Tests:

  • Extend Python version support to include Python 3.14 in test configurations

patrick91 avatar Apr 01 '25 17:04 patrick91

Reviewer's Guide

This PR enables Python 3.14 support by updating CI workflows and test sessions, adapting code compatibility, bumping test dependencies, extending poetry configuration, and adding a release announcement template.

Class diagram for Field class Python 3.14 compatibility update

classDiagram
    class Field {
        <<dataclass>>
        +__init__(...)
        +default
        +default_factory
        +doc  <<added in 3.14>>
    }

File-Level Changes

Change Details Files
Extend testing to Python 3.14 across CI and nox
  • Include 3.14-dev in GitHub Actions test matrix
  • Prepend 3.14 to nox PYTHON_VERSIONS
.github/workflows/test.yml
noxfile.py
Update GraphQL core version in test sessions
  • Bump GQL_CORE_VERSIONS from 3.2.3 to 3.2.6
noxfile.py
Add doc parameter for dataclasses in Python 3.14
  • Set kwargs['doc'] = None for Python >=3.14
strawberry/types/field.py
Enhance poetry configuration with optional codeflash group
  • Add tool.poetry.group.codeflash section and dependencies
pyproject.toml
Introduce TWEET.md release announcement template
  • Add stub for release tweet with placeholders
TWEET.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an issue from a review comment by replying to it. You can also reply to a review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull request title to generate a title at any time. You can also comment @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in the pull request body to generate a PR summary at any time exactly where you want it. You can also comment @sourcery-ai summary on the pull request to (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the pull request to resolve all Sourcery comments. Useful if you've already addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull request to dismiss all existing Sourcery reviews. Especially useful if you want to start fresh with a new review - don't forget to comment @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

  • Contact our support team for questions or feedback.
  • Visit our documentation for detailed guides and information.
  • Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.

sourcery-ai[bot] avatar Apr 01 '25 17:04 sourcery-ai[bot]

Codecov Report

:x: Patch coverage is 64.70588% with 6 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 94.28%. Comparing base (add26a6) to head (7741475). :warning: Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3828      +/-   ##
==========================================
- Coverage   94.29%   94.28%   -0.01%     
==========================================
  Files         532      532              
  Lines       34854    34860       +6     
  Branches     1843     1844       +1     
==========================================
+ Hits        32865    32869       +4     
- Misses       1686     1687       +1     
- Partials      303      304       +1     
:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Apr 01 '25 17:04 codecov[bot]

CodSpeed Performance Report

Merging #3828 will create unknown performance changes

Comparing feature/314 (7741475) with main (add26a6)

Summary

:warning: No benchmarks were detected in both the base of the PR and the PR. Please ensure that your benchmarks are correctly instrumented with CodSpeed.

Check out the benchmarks creation guide

⏩ 27 skipped[^skipped]

[^skipped]: 27 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

codspeed-hq[bot] avatar Apr 01 '25 17:04 codspeed-hq[bot]

Apollo Federation Subgraph Compatibility Results

Federation 1 Support Federation 2 Support
_service🟢
@key (single)🟢
@key (multi)🟢
@key (composite)🟢
repeatable @key🟢
@requires🟢
@provides🟢
federated tracing🔲
@link🟢
@shareable🟢
@tag🟢
@override🟢
@inaccessible🟢
@composeDirective🟢
@interfaceObject🟢

Learn more:

botberry avatar Jul 15 '25 22:07 botberry

It seems that we have 2 issues here:

  1. TypeError: Field.__init__() missing 1 required positional argument: 'doc'

the new field api has an optional doc keyword, which we need to add there.

Wondering if we should add doc and deprecate description? Wdyt? As field has doc now, it seems a good kw to retrieve it =P

  1. ImportError: cannot import name 'ByteString' from 'typing'

This is an issue from graphql-core, which has been fixed for 3.3.x.

Should we mark 3.14 only available with graphql-core 3.3.x+? Otherwise we might need to ask Cito to backport the fix to 3.2.x

bellini666 avatar Jul 16 '25 11:07 bellini666

It seems that we have 2 issues here:

  1. TypeError: Field.__init__() missing 1 required positional argument: 'doc'

the new field api has an optional doc keyword, which we need to add there.

Wondering if we should add doc and deprecate description? Wdyt? As field has doc now, it seems a good kw to retrieve it =P

Mmh, I don't really like doc :D I think I'd keep the same behaviour as it is now (so just passing None)

  1. ImportError: cannot import name 'ByteString' from 'typing'

This is an issue from graphql-core, which has been fixed for 3.3.x.

Should we mark 3.14 only available with graphql-core 3.3.x+? Otherwise we might need to ask Cito to backport the fix to 3.2.x

I'll make a PR to GraphQL-core, not sure when 3.3 will be released (I think it depends on GraphQL js)

patrick91 avatar Jul 16 '25 18:07 patrick91

Thanks for adding the RELEASE.md file!

Here's a preview of the changelog:


This release adds support for the upcoming Python 3.14

Here's the tweet text:

🆕 Release (next) is out! Thanks to @patrick91 for the PR 👏

This release adds support for Python 3.14!

Get it here 👉 https://strawberry.rocks/release/(next)

botberry avatar Jul 16 '25 22:07 botberry