Skip to content

Conversation

@hugovk
Copy link
Contributor

@hugovk hugovk commented Oct 6, 2018

Running pytest on master with Python 3.7.0:

=============================================== test session starts ================================================
platform darwin -- Python 3.7.0, pytest-3.8.1, py-1.5.4, pluggy-0.7.1
...
================================================= warnings summary =================================================
/private/tmp/toolz/toolz/itertoolz.py:394: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  if isinstance(seq, (tuple, list, collections.Sequence)):

-- Docs: https://docs.pytest.org/en/latest/warnings.html
====================================== 199 passed, 1 warnings in 8.34 seconds ======================================

No warning with this branch:

============================================ 199 passed in 7.91 seconds ============================================

Also Git ignore a file created when running tests to make sure it isn't committed by mistake.

@hugovk
Copy link
Contributor Author

hugovk commented Oct 6, 2018

The build failed for Python 3 because it's set up to fail if coverage is less than 100% and Python 3 doesn't hit the except ImportError bit:

$ if [[ $TRAVIS_PYTHON_VERSION != pypy* ]]; then coverage report --show-missing --fail-under=100 ; fi
Name                          Stmts   Miss  Cover   Missing
-----------------------------------------------------------
toolz/__init__.py                11      0   100%
toolz/_signatures.py            148      0   100%
toolz/curried/__init__.py        47      0   100%
toolz/curried/exceptions.py       8      0   100%
toolz/curried/operator.py        12      0   100%
toolz/dicttoolz.py               85      0   100%
toolz/functoolz.py              373      0   100%
toolz/itertoolz.py              345      2    99%   14-16
toolz/recipes.py                 10      0   100%
toolz/sandbox/__init__.py         2      0   100%
toolz/sandbox/core.py            37      0   100%
toolz/sandbox/parallel.py        14      0   100%
toolz/utils.py                    7      0   100%
-----------------------------------------------------------
TOTAL                          1099      2    99%
try:
    # Python 3
    from collections.abc import Sequence
except ImportError:
    # Python 2.7
    from collections import Sequence

I've added a # pragma: no cover to prevent this:

try:
    # Python 3
    from collections.abc import Sequence
except ImportError:  # pragma: no cover
    # Python 2.7
    from collections import Sequence

try:
# Python 3
from collections.abc import Sequence
except ImportError: # pragma: no cover
Copy link
Member

Choose a reason for hiding this comment

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

Instead of using try-except here, can we move these into the appropriate if PY3: else: blocks above?

btw, you can use # pragma: py2 no cover or # pragma: py3 no cover to only skip coverage if Python 2 or 3.

Copy link
Contributor Author

@hugovk hugovk Nov 13, 2018

Choose a reason for hiding this comment

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

Moved as part of a rebase to resolve conflicts!

Thanks, that's a good tip about # pragma: py2 no cover etc.

@groutr
Copy link
Contributor

groutr commented Dec 6, 2018

@eriknw, can this be merged?

@eriknw eriknw merged commit 5360b15 into pytoolz:master Dec 6, 2018
@hugovk hugovk deleted the fix-deprecation-warning branch December 6, 2018 16:07
@hugovk
Copy link
Contributor Author

hugovk commented Dec 6, 2018

It's been about a year since the last release, do you have a rough idea when the next is due out?

https://github.com/pytoolz/toolz/releases

Thank you!

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