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

import from collections.abc instead of from collections. #370

Merged

Conversation

Projects
None yet
2 participants
@Mariatta
Copy link
Member

commented May 30, 2019

To address pending deprecation warning.

What do these changes do?

Instead of importing from collections, import from collections.abc

Are there changes in behavior for the user?

Users in 3.7+ would see deprecation warning:

DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working

With this change, the deprecation warning disappears in Python 3.7.1+

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> (e.g. 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.
import from collections.abc instead of from collections.
To address pending deprecation warning.
@codecov

This comment has been minimized.

Copy link

commented May 30, 2019

Codecov Report

Merging #370 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #370   +/-   ##
=======================================
  Coverage   97.26%   97.26%           
=======================================
  Files           4        4           
  Lines         219      219           
  Branches       26       26           
=======================================
  Hits          213      213           
  Misses          4        4           
  Partials        2        2
Impacted Files Coverage Δ
aiohttp_session/__init__.py 98.1% <100%> (ø) ⬆️

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 10962a6...906bc67. Read the comment docs.

Mariatta added some commits May 30, 2019

@Mariatta

This comment has been minimized.

Copy link
Member Author

commented May 30, 2019

If you provide code modification, please add yourself to CONTRIBUTORS.txt

There is no CONTRIBUTORS.txt file in this repo. Should I create PR to adjust the template?

@asvetlov
Copy link
Member

left a comment

please remove conditional import

from collections import MutableMapping

try:
from collections.abc import MutableMapping

This comment has been minimized.

Copy link
@asvetlov

asvetlov May 30, 2019

Member

No need for try/except block here.
All supported python versions provide collections.abc module

This comment has been minimized.

Copy link
@Mariatta

Mariatta May 30, 2019

Author Member

Ok, updated. Thanks.

@asvetlov

This comment has been minimized.

Copy link
Member

commented May 30, 2019

There is no CONTRIBUTORS.txt file in this repo. Should I create PR to adjust the template?

There is an issue aio-libs/.github#1

Any help is welcome!

@asvetlov asvetlov merged commit 642b59a into aio-libs:master May 30, 2019

4 of 5 checks passed

LGTM analysis: JavaScript No code changes detected
Details
LGTM analysis: Python No new or fixed alerts
Details
Travis CI - Pull Request Build Passed
Details
codecov/patch 100% of diff hit (target 97.26%)
Details
codecov/project 97.26% (+0%) compared to 10962a6
Details
@asvetlov

This comment has been minimized.

Copy link
Member

commented May 30, 2019

Thanks!

@Mariatta Mariatta deleted the Mariatta:collections-abc-deprecation-warning branch May 30, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.