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

Revert incorrect typing changes #10222

Merged
merged 9 commits into from
Feb 6, 2025
Merged

Revert incorrect typing changes #10222

merged 9 commits into from
Feb 6, 2025

Conversation

Dreamsorcerer
Copy link
Member

@Dreamsorcerer Dreamsorcerer commented Dec 23, 2024

From #9528. This should work again with mypy 1.14.

Add some new flags too.

Edit: Not actually fixed in mypy 1.14. Waiting for 1.15 for proper fix.

@Dreamsorcerer Dreamsorcerer added bot:chronographer:skip This PR does not need to include a change note backport-3.12 Trigger automatic backporting to the 3.12 release branch by Patchback robot labels Dec 23, 2024
Copy link

codecov bot commented Dec 23, 2024

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
3466 1 3465 93
View the top 1 failed tests by shortest run time
tests.test_client_ws_functional test_heartbeat[pyloop]
Stack Traces | 0.244s run time
aiohttp_client = <function aiohttp_client.<locals>.go at 0x00000195F1950D30>

    #x1B[0m#x1B[94masync#x1B[39;49;00m #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mtest_heartbeat#x1B[39;49;00m(aiohttp_client: AiohttpClient) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        ping_received = #x1B[94mFalse#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[94masync#x1B[39;49;00m #x1B[94mdef#x1B[39;49;00m#x1B[90m #x1B[39;49;00m#x1B[92mhandler#x1B[39;49;00m(request: web.Request) -> NoReturn:#x1B[90m#x1B[39;49;00m
            #x1B[94mnonlocal#x1B[39;49;00m ping_received#x1B[90m#x1B[39;49;00m
            ws = web.WebSocketResponse(autoping=#x1B[94mFalse#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
            #x1B[94mawait#x1B[39;49;00m ws.prepare(request)#x1B[90m#x1B[39;49;00m
            msg = #x1B[94mawait#x1B[39;49;00m ws.receive()#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m msg.type == aiohttp.WSMsgType.PING#x1B[90m#x1B[39;49;00m
            ping_received = #x1B[94mTrue#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
            #x1B[94mawait#x1B[39;49;00m ws.close()#x1B[90m#x1B[39;49;00m
            #x1B[94massert#x1B[39;49;00m #x1B[94mFalse#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        app = web.Application()#x1B[90m#x1B[39;49;00m
        app.router.add_route(#x1B[33m"#x1B[39;49;00m#x1B[33mGET#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, #x1B[33m"#x1B[39;49;00m#x1B[33m/#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, handler)#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        client = #x1B[94mawait#x1B[39;49;00m aiohttp_client(app)#x1B[90m#x1B[39;49;00m
        resp = #x1B[94mawait#x1B[39;49;00m client.ws_connect(#x1B[33m"#x1B[39;49;00m#x1B[33m/#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m, heartbeat=#x1B[94m0.01#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        #x1B[94mawait#x1B[39;49;00m asyncio.sleep(#x1B[94m0.1#x1B[39;49;00m)#x1B[90m#x1B[39;49;00m
        #x1B[94mawait#x1B[39;49;00m resp.receive()#x1B[90m#x1B[39;49;00m
        #x1B[94mawait#x1B[39;49;00m resp.close()#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
>       #x1B[94massert#x1B[39;49;00m ping_received#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE       assert False#x1B[0m

aiohttp_client = <function aiohttp_client.<locals>.go at 0x00000195F1950D30>
app        = <Application 0x195f0f68eb0>
client     = <aiohttp.test_utils.TestClient object at 0x00000195F0C22130>
handler    = <function test_heartbeat.<locals>.handler at 0x00000195F0BA1E50>
ping_received = True
resp       = <aiohttp.client_ws.ClientWebSocketResponse object at 0x00000195F1E7CB50>

#x1B[1m#x1B[31mtests\test_client_ws_functional.py#x1B[0m:758: AssertionError

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

Copy link

codspeed-hq bot commented Dec 23, 2024

CodSpeed Performance Report

Merging #10222 will not alter performance

Comparing Dreamsorcerer-patch-1 (236b233) with master (e6ed541)

Summary

✅ 47 untouched benchmarks

@Dreamsorcerer
Copy link
Member Author

Pending dependabot PR, which should catch up over the next 2 days.

@webknjaz
Copy link
Member

Pending dependabot PR, which should catch up over the next 2 days.

@Dreamsorcerer alternatively we could just bump all the deps manually, with a local pip-tools run. And avoid those annoying Dependabot notifications coming in every day..

@asvetlov
Copy link
Member

Sorry, guys, I've missed what are you talking about.
@webknjaz do you want to disable dependabot for the project?

@Dreamsorcerer
Copy link
Member Author

Pending dependabot PR, which should catch up over the next 2 days.

@Dreamsorcerer alternatively we could just bump all the deps manually, with a local pip-tools run. And avoid those annoying Dependabot notifications coming in every day..

I'm just being lazy. Could have also manually triggered Dependabot. I think using Dependabot is still preferable, but would be great to filter out those notifications...

@webknjaz
Copy link
Member

do you want to disable dependabot for the project?

No, not right now anyway. The problem is that it was stuck for a while, and Sam fixed it just the other day. Now it's trying to catch up by creating a gazillion of PRs, one per each dependency. It calls pip-compile under the hood. A more efficient way could be running it manually to bump everything just this once, so dependabot would be less noisy.

The current setup is not very flexible and has a number of issues in the space of package management, so it's possible to fundamentally rework it, but it requires a certain amount of focused effort. This is why I'm not jumping right into it, even though I've done this research multiple times elsewhere and have really good practices that work.

@Dreamsorcerer Dreamsorcerer merged commit 0d44b6a into master Feb 6, 2025
40 checks passed
@Dreamsorcerer Dreamsorcerer deleted the Dreamsorcerer-patch-1 branch February 6, 2025 15:12
Copy link
Contributor

patchback bot commented Feb 6, 2025

Backport to 3.12: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply 0d44b6a on top of patchback/backports/3.12/0d44b6acace64f73045c14869af9069dc801926e/pr-10222

Backporting merged PR #10222 into master

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    $ git remote add upstream https://github.com/aio-libs/aiohttp.git
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    $ git fetch upstream
    $ git checkout -b patchback/backports/3.12/0d44b6acace64f73045c14869af9069dc801926e/pr-10222 upstream/3.12
  4. Now, cherry-pick PR Revert incorrect typing changes #10222 contents into that branch:
    $ git cherry-pick -x 0d44b6acace64f73045c14869af9069dc801926e
    If it'll yell at you with something like fatal: Commit 0d44b6acace64f73045c14869af9069dc801926e is a merge but no -m option was given., add -m 1 as follows instead:
    $ git cherry-pick -m1 -x 0d44b6acace64f73045c14869af9069dc801926e
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR Revert incorrect typing changes #10222 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/3.12/0d44b6acace64f73045c14869af9069dc801926e/pr-10222
  7. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

Dreamsorcerer added a commit that referenced this pull request Feb 6, 2025
@Dreamsorcerer Dreamsorcerer added backport:skip Skip backport bot and removed backport-3.12 Trigger automatic backporting to the 3.12 release branch by Patchback robot labels Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip Skip backport bot bot:chronographer:skip This PR does not need to include a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants