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 wildcard imports #3469

Merged
merged 6 commits into from
Dec 28, 2018
Merged

Conversation

thanosexcite
Copy link
Contributor

What do these changes do?

Removes wildcard imports, so that mypy and other linters will be able to follow imports correctly.

⚠️ I wasn't able to use single import statement, while keeping both flake8 and isort happy with existing config. Someone else could improve it?

Are there changes in behavior for the user?

No.

Related issue number

#3468

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."

@codecov-io
Copy link

codecov-io commented Dec 28, 2018

Codecov Report

Merging #3469 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3469      +/-   ##
==========================================
- Coverage   97.93%   97.93%   -0.01%     
==========================================
  Files          44       44              
  Lines        8559     8557       -2     
  Branches     1383     1383              
==========================================
- Hits         8382     8380       -2     
  Misses         74       74              
  Partials      103      103
Impacted Files Coverage Δ
aiohttp/payload_streamer.py 100% <ø> (ø) ⬆️
aiohttp/web_middlewares.py 100% <ø> (ø) ⬆️
aiohttp/tracing.py 100% <ø> (ø) ⬆️
aiohttp/web_exceptions.py 100% <ø> (ø) ⬆️
aiohttp/web_runner.py 97.92% <ø> (ø) ⬆️
aiohttp/web_server.py 100% <ø> (ø) ⬆️
aiohttp/http_writer.py 98.11% <ø> (ø) ⬆️
aiohttp/formdata.py 98.87% <ø> (ø) ⬆️
aiohttp/streams.py 99.22% <ø> (ø) ⬆️
aiohttp/http_exceptions.py 100% <ø> (ø) ⬆️
... and 32 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2a346da...6246c40. Read the comment docs.

@asvetlov asvetlov merged commit 7a324fd into aio-libs:master Dec 28, 2018
@asvetlov
Copy link
Member

Thanks!

asvetlov pushed a commit that referenced this pull request Dec 28, 2018
@thanosexcite thanosexcite deleted the rm-wildcard-imports branch December 31, 2018 05:57
cognifloyd added a commit to cognifloyd/connexion that referenced this pull request May 22, 2019
Somewhere between 3.5.1 and 3.5.2, the aiohttp reimport started
succeeding (in connexion.connexion.cli.run()). It's not clear which
change caused the issue, but it's probably one of:

- aio-libs/aiohttp#3469 (Remove wildcard imports)
- aio-libs/aiohttp#3464 (Don't suppress gunicorn cleanup errors)
- aio-libs/aiohttp#3471 (Refactor workers)
- aio-libs/aiohttp#3500 (Ignore done tasks)

In any case, setting sys.modules['aiohttp'] = None should prevent
reimporting it. See: https://stackoverflow.com/a/1350574

I successfully tested locally on py37 with aiohttp 3.5.1 and 3.5.2.
hjacobs pushed a commit to spec-first/connexion that referenced this pull request Oct 15, 2019
* Revert "set max aiohttp version to 3.5.1 (until build is fixed) (#844)"

This reverts commit b2a4287.

* Fix test_run_with_aiohttp_not_installed

Somewhere between 3.5.1 and 3.5.2, the aiohttp reimport started
succeeding (in connexion.connexion.cli.run()). It's not clear which
change caused the issue, but it's probably one of:

- aio-libs/aiohttp#3469 (Remove wildcard imports)
- aio-libs/aiohttp#3464 (Don't suppress gunicorn cleanup errors)
- aio-libs/aiohttp#3471 (Refactor workers)
- aio-libs/aiohttp#3500 (Ignore done tasks)

In any case, setting sys.modules['aiohttp'] = None should prevent
reimporting it. See: https://stackoverflow.com/a/1350574

I successfully tested locally on py37 with aiohttp 3.5.1 and 3.5.2.
@lock
Copy link

lock bot commented Jan 1, 2020

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Jan 1, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Jan 1, 2020
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Jan 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bot:chronographer:provided There is a change note present in this PR outdated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants