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 DeprecationWarnings #102

Merged
merged 2 commits into from
Sep 24, 2018
Merged

Fix DeprecationWarnings #102

merged 2 commits into from
Sep 24, 2018

Conversation

hugovk
Copy link
Contributor

@hugovk hugovk commented Sep 24, 2018

There are a couple of deprecation warnings on Python 3.7:

⌂112% [hugo:/tmp/dominate] master ± find . -name "*.pyc" -exec rm -f {} \;
⌂112% [hugo:/tmp/dominate] master ± pytest
================================================================ test session starts =================================================================
platform darwin -- Python 3.7.0, pytest-3.8.1, py-1.5.4, pluggy-0.7.1
rootdir: /private/tmp/dominate, inifile:
plugins: cov-2.5.1, flaky-3.4.0
collected 28 items

tests/test_document.py ....                                                                                                                    [ 14%]
tests/test_dom1core.py .                                                                                                                       [ 17%]
tests/test_html.py ...................                                                                                                         [ 85%]
tests/test_utils.py ....                                                                                                                       [100%]
===Flaky Test Report===


===End Flaky Test Report===

================================================================== warnings summary ==================================================================
/private/tmp/dominate/dominate/dom_tag.py:23: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import defaultdict, namedtuple, Callable

/private/tmp/dominate/dominate/util.py:87: DeprecationWarning: invalid escape sequence \d
  cc = re.compile('&(?:(?:#(\d+))|([^;]+));')

-- Docs: https://docs.pytest.org/en/latest/warnings.html
======================================================= 28 passed, 2 warnings in 0.39 seconds ========================================================

Changes proposed in this pull request:

  • Prefer collections.abc (new in Python 3.3) over collections for abstract base classes
  • "In Python 3.8, the abstract base classes in collections.abc will no longer be exposed in the regular collections module. This will help create a clearer distinction between the concrete classes and the abstract base classes."
  • https://docs.python.org/3.7/whatsnew/3.7.html#deprecated
  • Declare the regex string as a raw string with r so the \d isn't treated as an escaped character

After

⌂92% [hugo:/tmp/dominate] fix-deprecationwarnings ± find . -name "*.pyc" -exec rm -f {} \;
⌂87% [hugo:/tmp/dominate] fix-deprecationwarnings ± pytest
================================================================ test session starts =================================================================
platform darwin -- Python 3.7.0, pytest-3.8.1, py-1.5.4, pluggy-0.7.1
rootdir: /private/tmp/dominate, inifile:
plugins: cov-2.5.1, flaky-3.4.0
collected 28 items

tests/test_document.py ....                                                                                                                    [ 14%]
tests/test_dom1core.py .                                                                                                                       [ 17%]
tests/test_html.py ...................                                                                                                         [ 85%]
tests/test_utils.py ....                                                                                                                       [100%]
===Flaky Test Report===


===End Flaky Test Report===

============================================================= 28 passed in 0.41 seconds ==============================================================

@coveralls
Copy link

coveralls commented Sep 24, 2018

Coverage Status

Coverage decreased (-1.1%) to 95.393% when pulling cd4d482 on hugovk:fix-deprecationwarnings into a1dacee on Knio:master.

@Knio Knio merged commit 9778bb1 into Knio:master Sep 24, 2018
@hugovk hugovk deleted the fix-deprecationwarnings branch September 24, 2018 16:52
Knio pushed a commit that referenced this pull request Sep 25, 2018
* Fix DeprecationWarning in Python 3.7

* Fix DeprecationWarning in Python 3.6
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