Skip to content

Run CI tests on 3.14 #1331

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

Merged
merged 2 commits into from
May 26, 2025
Merged

Run CI tests on 3.14 #1331

merged 2 commits into from
May 26, 2025

Conversation

amyreese
Copy link
Member

Summary

Adds 3.14 to the CI matrix

Test Plan

Look at CI results

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 19, 2025
@amyreese amyreese requested a review from zsol May 19, 2025 23:29
@zsol
Copy link
Member

zsol commented May 20, 2025

Looks like the tests are failing

@ngoldbaum
Copy link
Contributor

I can't reproduce the crash on the Mac build but I do see the failure the other runners also saw.

The exception comes from here:

# Now, convert the type to allow for MetadataMatchType and MatchIfTrue values.
if isinstance(typecst, cst.Subscript):
clean_type = _get_clean_type_from_subscript(aliases, typecst)
elif isinstance(typecst, (cst.Name, cst.SimpleString)):
clean_type = _get_clean_type_from_expression(aliases, typecst)
else:
raise Exception("Logic error, unexpected top level type!")

If I modify that error to tell me about the type that's getting passed in, I get

Exception: Logic error, unexpected top level type! Found BinaryOperation(
    left=SimpleString(
        value="'BaseExpression'",
        lpar=[],
        rpar=[],
    ),
    operator=BitOr(
        whitespace_before=SimpleWhitespace(
            value=' ',
        ),
        whitespace_after=SimpleWhitespace(
            value=' ',
        ),
    ),
    right=Name(
        value='None',
        lpar=[],
        rpar=[],
    ),
    lpar=[],
    rpar=[],
) with type <class 'libcst._nodes.expression.BinaryOperation'>

In a debugger, going up the call stack, it's dying trying to parse the type string 'libcst._nodes.expression.BaseExpression | None'.

I don't know enough about libcst to have any idea why this only happens on 3.14.

@zsol
Copy link
Member

zsol commented May 25, 2025

Looks like this is a genuine bug, deferred annotations is causing the type string to appear as BaseExpression | None but in 3.13 and before, it used to be Optional[BaseExpression]. I'll look at fixing this

@zsol
Copy link
Member

zsol commented May 25, 2025

#1336 should help

@zsol
Copy link
Member

zsol commented May 26, 2025

Rebased on main + added 3.14t to the test matrix

@zsol zsol merged commit efae53d into Instagram:main May 26, 2025
37 checks passed
@amyreese amyreese deleted the py-314 branch May 26, 2025 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants