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

updated precommit #39

Merged
merged 1 commit into from
Jun 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/python/black
rev: 20.8b1
rev: 23.3.0
hooks:
- id: black

2 changes: 2 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[mypy-requests_toolbelt.*]
ignore_missing_imports = True
19 changes: 11 additions & 8 deletions src/metadata_parser/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from typing import Callable
from typing import Iterable
from typing import Optional
from typing import TYPE_CHECKING
from typing import Union
import unicodedata
from urllib.parse import ParseResult
Expand All @@ -21,19 +22,21 @@
from urllib.parse import urlunparse
import warnings

if __debug__:
# only used for testing. turn off in most production env with -o flags
import pdb # noqa: F401
import pprint # noqa: F401

# pypi
from bs4 import BeautifulSoup
from bs4 import Tag as _bs4_Tag # typing
import requests
from requests.structures import CaseInsensitiveDict
from requests_toolbelt.utils.deprecated import get_encodings_from_content # type: ignore[import]
from requests_toolbelt.utils.deprecated import get_encodings_from_content

if TYPE_CHECKING:
from bs4 import Tag as _bs4_Tag


if __debug__:
# only used for testing. turn off in most production env with -o flags
import pdb # noqa: F401
import pprint # noqa: F401

# ==============================================================================


Expand Down Expand Up @@ -2006,7 +2009,7 @@ def parse(
return

# set the searchpath
doc_searchpath: _bs4_Tag = doc.html # bs4.element.Tag
doc_searchpath: "_bs4_Tag" = doc.html # bs4.element.Tag

# shortcut
parsed_result = self.parsed_result
Expand Down