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

remove import aliases #7153

Merged
merged 3 commits into from Jan 14, 2023
Merged

Conversation

dtrifiro
Copy link
Contributor

@dtrifiro dtrifiro commented Dec 30, 2022

What do these changes do?

Clean up imports by removing import aliases

Are there changes in behavior for the user?

No

Related issue number

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> for example (588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the pr
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files."

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Dec 30, 2022
AsyncResolver as AsyncResolver,
DefaultResolver as DefaultResolver,
ThreadedResolver as ThreadedResolver,
PAYLOAD_REGISTRY,

Check warning

Code scanning / CodeQL

Importing value of mutable attribute

Importing the value of 'PAYLOAD_REGISTRY' from [module aiohttp.payload](1) means that any change made to [aiohttp.payload.PAYLOAD_REGISTRY](2) will be not be observed locally. Importing the value of 'PAYLOAD_REGISTRY' from [module aiohttp.payload](1) means that any change made to [aiohttp.payload.PAYLOAD_REGISTRY](3) will be not be observed locally.
@codecov
Copy link

codecov bot commented Dec 30, 2022

Codecov Report

Merging #7153 (fdc7e2d) into master (283861d) will not change coverage.
The diff coverage is 94.11%.

@@           Coverage Diff           @@
##           master    #7153   +/-   ##
=======================================
  Coverage   97.37%   97.37%           
=======================================
  Files         106      106           
  Lines       31093    31093           
  Branches     3875     3875           
=======================================
  Hits        30278    30278           
  Misses        613      613           
  Partials      202      202           
Flag Coverage Δ
CI-GHA 97.28% <94.11%> (ø)
OS-Linux 96.94% <94.11%> (-0.01%) ⬇️
OS-Windows 95.35% <93.75%> (ø)
OS-macOS 96.50% <94.11%> (-0.01%) ⬇️
Py-3.10.9 97.03% <94.11%> (ø)
Py-3.11.0 95.59% <94.11%> (-0.01%) ⬇️
Py-3.7.15 96.75% <94.11%> (ø)
Py-3.7.9 95.23% <93.75%> (ø)
Py-3.8.10 95.13% <93.75%> (-0.01%) ⬇️
Py-3.8.15 96.65% <94.11%> (ø)
Py-3.9.13 95.12% <93.75%> (-0.01%) ⬇️
Py-3.9.16 96.66% <94.11%> (-0.01%) ⬇️
Py-pypy7.3.10 ?
Py-pypy7.3.11 94.16% <94.11%> (?)
VM-macos 96.50% <94.11%> (-0.01%) ⬇️
VM-ubuntu 96.94% <94.11%> (-0.01%) ⬇️
VM-windows 95.35% <93.75%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
aiohttp/__init__.py 92.85% <80.00%> (ø)
aiohttp/client.py 94.16% <100.00%> (ø)
aiohttp/http.py 100.00% <100.00%> (ø)
aiohttp/web.py 99.18% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Dreamsorcerer
Copy link
Member

These were probably done like this as an explicit reexport: https://mypy.readthedocs.io/en/stable/config_file.html?highlight=reexport#confval-implicit_reexport

As we add all of them to __all__, that may be unneeded though...

@dtrifiro dtrifiro marked this pull request as ready for review January 2, 2023 12:01
@Dreamsorcerer Dreamsorcerer added the bot:chronographer:skip This PR does not need to include a change note label Jan 14, 2023
@Dreamsorcerer
Copy link
Member

Dreamsorcerer commented Jan 14, 2023

Right, this was introduced for mypy 0.710 which added the explicit reexport option. Support for __all__ was added later in 0.730. So, I'm going to merge this, as the syntax has not been needed for a long time.

(I removed the change file as there should be no visible change to the user).

@Dreamsorcerer
Copy link
Member

I'll add the 3.9 backport flag, but I'm sure it will fail to backport automatically..

@Dreamsorcerer Dreamsorcerer added the backport-3.9 Trigger automatic backporting to the 3.9 release branch by Patchback robot label Jan 14, 2023
@Dreamsorcerer Dreamsorcerer enabled auto-merge (squash) January 14, 2023 14:37
@Dreamsorcerer Dreamsorcerer merged commit 4635161 into aio-libs:master Jan 14, 2023
@patchback
Copy link
Contributor

patchback bot commented Jan 14, 2023

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

❌ Failed to cleanly apply 4635161 on top of patchback/backports/3.9/4635161ee8e7ad321cca46e01ce5bfeb1ad8bf26/pr-7153

Backporting merged PR #7153 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.9/4635161ee8e7ad321cca46e01ce5bfeb1ad8bf26/pr-7153 upstream/3.9
  4. Now, cherry-pick PR remove import aliases #7153 contents into that branch:
    $ git cherry-pick -x 4635161ee8e7ad321cca46e01ce5bfeb1ad8bf26
    If it'll yell at you with something like fatal: Commit 4635161ee8e7ad321cca46e01ce5bfeb1ad8bf26 is a merge but no -m option was given., add -m 1 as follows intead:
    $ git cherry-pick -m1 -x 4635161ee8e7ad321cca46e01ce5bfeb1ad8bf26
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR remove import aliases #7153 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/3.9/4635161ee8e7ad321cca46e01ce5bfeb1ad8bf26/pr-7153
  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.

@dtrifiro dtrifiro deleted the remove-import-aliases branch January 16, 2023 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-3.9 Trigger automatic backporting to the 3.9 release branch by Patchback robot bot:chronographer:provided There is a change note present in this PR 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.

None yet

2 participants