Skip to content

replaced collections with collections.abc for inheritance - #28

Merged
takluyver merged 15 commits into
ipython:masterfrom
jmfrank63:fix_collections_deprecation
Sep 25, 2018
Merged

takluyver merged 15 commits into
ipython:masterfrom
jmfrank63:fix_collections_deprecation

Conversation

@jmfrank63

@jmfrank63 jmfrank63 commented Sep 24, 2018 •

Copy link
Copy Markdown
Contributor

Importing directly from collection is deprecated in python 3.7 and will stop to work in python 3.8

CI tests with -W error will already fail now.

By replacing collections with collections.abc this problem will be fixed.

Addresses #27

@takluyver

Copy link
Copy Markdown
Member

Unfortunately it looks like collections.abc is not in Python 2.7.

We'll either need to extend the compatibility code around line 56 a bit, or make a new release explicitly Python 3 only and cut out all the compatibility code. Pickleshare needs so few changes that I'd lean towards the latter approach.

@jmfrank63

jmfrank63 commented Sep 25, 2018 •

Copy link
Copy Markdown
Contributor Author

Oh, I understand, I'll change this to:

try:
    import collections.abc as collections_abc
 except ImportError:
    import collections as collections_abc

and then inherit from collections_abc

Once I am at home I'll add this. That should work for python 2.7 as well.

@jmfrank63

Copy link
Copy Markdown
Contributor Author

Passes now, but you can safely add 3.6 and 3.7 to the test too. 3.7 ran fine on my machine.

@takluyver

Copy link
Copy Markdown
Member

Thanks. Do you want to add those in .travis.yml while you're working on it? They're not there just because it hasn't been touched in a couple of years.

@jmfrank63

Copy link
Copy Markdown
Contributor Author

Interesting, I think we are save if we move to xenial for >= python 3.7

@jmfrank63

Copy link
Copy Markdown
Contributor Author

Finally, we can talk about additional pypy testing ;-)
Sorry for the trial and error, I am completely new to travis.
But we should be good now for a while.

Comment thread .travis.yml Outdated
- "3.4"
- 3.5
dist: trusty
sudo: required

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think we need either sudo or the dist specification here, we can just let it use the defaults except for 3.7 and 3.8.

Comment thread .travis.yml Outdated
- "3.5"
- "3.6-dev"
- "3.6"
- "3.7-dev"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's drop the 3.5/6/7 dev versions. Pickleshare has needed no changes for new Python versions - up to now - for several years. I know that 3.7-dev is also stuck somewhere in the past before the openssl requirement shifted.

Comment thread .travis.yml Outdated
dist: xenial
sudo: true
install: pip install -e .
script: py.test

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also, I don't think these sections need the install & script lines - Travis should use the top-level ones for all matrix items that don't override them. Sorry for not noticing that before.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No worries, I'll check, ...

@jmfrank63

Copy link
Copy Markdown
Contributor Author

@takluyver Do you think we get this done tonight? I am not very experienced in this, a bloody beginner, sorry to ask. My trio tests fail currently and I'd be happy to work on them as soon as possible.

@takluyver
takluyver merged commit 7b7c99a into ipython:master Sep 25, 2018
@takluyver

Copy link
Copy Markdown
Member

Yup, I think we can. Thanks!

@jmfrank63

Copy link
Copy Markdown
Contributor Author

Thank you, step by step I am getting a better overview how this works. Great help.

@takluyver

Copy link
Copy Markdown
Member

No problem. I probably need to put a new release on PyPI before you can easily pick it up for trio tests, but that shouldn't take long.

@jmfrank63

Copy link
Copy Markdown
Contributor Author

That would have been my next questions ;-) Enjoy your week.

@jmfrank63
jmfrank63 deleted the fix_collections_deprecation branch September 25, 2018 19:11
@takluyver

Copy link
Copy Markdown
Member

@njsmith

njsmith commented Sep 26, 2018

Copy link
Copy Markdown

Thanks @takluyver!

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.

3 participants