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

Fix importing ABC from collections in Python 3. #393

Merged
merged 2 commits into from Jun 10, 2020
Merged

Fix importing ABC from collections in Python 3. #393

merged 2 commits into from Jun 10, 2020

Conversation

tirkarthi
Copy link
Contributor

Please confirm that this PR has done the following:

  • Tests Added
  • Documentation Added
  • Description in RELEASE_NOTES.md Added

Adding to RELEASE_NOTES.md (remove section after adding to RELEASE_NOTES.md)

Please add a single line in the release notes similar to the following:

- (#XX)[http://link-to-pr.com] Added feature which does something

Description of PR

Fixes #377 . It also fixes several more instances in addition to the one reported in #377

@coveralls
Copy link

coveralls commented Jun 9, 2020

Coverage Status

Coverage decreased (-0.2%) to 90.866% when pulling 20814d2 on tirkarthi:fix-warnings into 8145740 on IAMconsortium:master.

@danielhuppmann
Copy link
Member

thanks @tirkarthi for this fix! I actually started on something similar, see danielhuppmann@c4c8f19 - is there any specific reason for preferring
from six.moves.collections_abc import Iterable
over
from collections.abc import Iterable?

@tirkarthi
Copy link
Contributor Author

ABC can be imported from collections only in Python. In Python 3 collections.abc is recommended. Using six would ensure it works on both python 2 and 3. I assumed Python 2 is supported by the project. If not then directly using collections.abc is a simple solution. Does the project support Python 2?

@danielhuppmann
Copy link
Member

Thanks! I believe that all major packages are dropping support for python 2, and we started using f'{}'-strings for formatting, which are incompatible with versions before 3.6 anyway (afaik)...

@tirkarthi
Copy link
Contributor Author

Thanks, I will modify the PR

@tirkarthi
Copy link
Contributor Author

@danielhuppmann I have force pushed my changes to ensure collections.abc is used instead of six.

@danielhuppmann
Copy link
Member

Thanks @tirkarthi! Can you still add a line to the release notes? Note that this is the first PR since the last release, so you'll need to insert it between # Next Release and # Release v0.6.0.

@danielhuppmann danielhuppmann self-requested a review June 9, 2020 14:58
@danielhuppmann
Copy link
Member

Thanks, resolved the merge conflict for you!

@tirkarthi
Copy link
Contributor Author

Sorry, I didn't notice and force pushed my change resolving the conflict.

Copy link
Member

@danielhuppmann danielhuppmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @tirkarthi for this nice improvement!

@danielhuppmann danielhuppmann merged commit 808294b into IAMconsortium:master Jun 10, 2020
@tirkarthi
Copy link
Contributor Author

Thanks @danielhuppmann for the review and merge :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecation warnings for python 3.9
3 participants