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

pulling in pip internals causes depreciation warning #924

Closed
belm0 opened this issue Apr 14, 2019 · 3 comments · Fixed by #928
Closed

pulling in pip internals causes depreciation warning #924

belm0 opened this issue Apr 14, 2019 · 3 comments · Fixed by #928

Comments

@belm0
Copy link

belm0 commented Apr 14, 2019

import isort
../../../../virtualenv/python3.7.1/lib/python3.7/site-packages/isort/__init__.py:26: in <module>
    from .isort import SortImports  # noqa: F401
../../../../virtualenv/python3.7.1/lib/python3.7/site-packages/isort/isort.py:41: in <module>
    from .finders import FindersManager
../../../../virtualenv/python3.7.1/lib/python3.7/site-packages/isort/finders.py:24: in <module>
    from pip._internal.download import PipSession
../../../../virtualenv/python3.7.1/lib/python3.7/site-packages/pip/_internal/__init__.py:40: in <module>
    from pip._internal.cli.autocompletion import autocomplete
../../../../virtualenv/python3.7.1/lib/python3.7/site-packages/pip/_internal/cli/autocompletion.py:8: in <module>
    from pip._internal.cli.main_parser import create_main_parser
../../../../virtualenv/python3.7.1/lib/python3.7/site-packages/pip/_internal/cli/main_parser.py:12: in <module>
    from pip._internal.commands import (
../../../../virtualenv/python3.7.1/lib/python3.7/site-packages/pip/_internal/commands/__init__.py:6: in <module>
    from pip._internal.commands.completion import CompletionCommand
../../../../virtualenv/python3.7.1/lib/python3.7/site-packages/pip/_internal/commands/completion.py:6: in <module>
    from pip._internal.cli.base_command import Command
../../../../virtualenv/python3.7.1/lib/python3.7/site-packages/pip/_internal/cli/base_command.py:25: in <module>
    from pip._internal.index import PackageFinder
../../../../virtualenv/python3.7.1/lib/python3.7/site-packages/pip/_internal/index.py:14: in <module>
    from pip._vendor import html5lib, requests, six
../../../../virtualenv/python3.7.1/lib/python3.7/site-packages/pip/_vendor/html5lib/__init__.py:25: in <module>
    from .html5parser import HTMLParser, parse, parseFragment
../../../../virtualenv/python3.7.1/lib/python3.7/site-packages/pip/_vendor/html5lib/html5parser.py:8: in <module>
    from . import _tokenizer
../../../../virtualenv/python3.7.1/lib/python3.7/site-packages/pip/_vendor/html5lib/_tokenizer.py:16: in <module>
    from ._trie import Trie
../../../../virtualenv/python3.7.1/lib/python3.7/site-packages/pip/_vendor/html5lib/_trie/__init__.py:3: in <module>
    from .py import Trie as PyTrie
../../../../virtualenv/python3.7.1/lib/python3.7/site-packages/pip/_vendor/html5lib/_trie/py.py:6: in <module>
    from ._base import Trie as ABCTrie
../../../../virtualenv/python3.7.1/lib/python3.7/site-packages/pip/_vendor/html5lib/_trie/_base.py:3: in <module>
    from collections import Mapping
<frozen importlib._bootstrap>:1032: in _handle_fromlist
    ???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
name = 'Mapping'
    def __getattr__(name):
        # For backwards compatibility, continue to make the collections ABCs
        # through Python 3.6 available through the collections module.
        # Note, no new collections ABCs were added in Python 3.7
        if name in _collections_abc.__all__:
            obj = getattr(_collections_abc, name)
            import warnings
            warnings.warn("Using or importing the ABCs from 'collections' instead "
                          "of from 'collections.abc' is deprecated, "
                          "and in 3.8 it will stop working",
>                         DeprecationWarning, stacklevel=2)
E           DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
../../../../virtualenv/python3.7.1/lib/python3.7/collections/__init__.py:52: DeprecationWarning

Since pip has internal copy of html5 with the deprecated use, it's very hard to manage this as an isort package user.

@belm0
Copy link
Author

belm0 commented Apr 14, 2019

potential solution: use parse_requirements() from pip-api package

https://pypi.org/project/pip-api/

@belm0 belm0 changed the title pulling in pip internals caused depreciation warning pulling in pip internals causes depreciation warning Apr 14, 2019
@di
Copy link
Contributor

di commented Apr 17, 2019

Hi, I'm the maintainer of pip-api. I'm not very familiar with the internals of isort but I'd be happy to submit a PR migrating this project towards using it if a maintainer is interested!

@timothycrosley
Copy link
Member

Hi @di,

I would be very happy to merge in any such pull request.

Thank you!

~Timothy

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 a pull request may close this issue.

3 participants