Skip to content

Commit 35cc964

Browse files
authored
changes for release (#45)
1 parent a975889 commit 35cc964

5 files changed

Lines changed: 29 additions & 16 deletions

File tree

.pre-commit-config.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
# See https://pre-commit.com for more information
22
# See https://pre-commit.com/hooks.html for more hooks
33
repos:
4-
- repo: https://github.com/python/black
5-
rev: 23.3.0
4+
- repo: https://github.com/psf/black
5+
rev: 24.8.0
66
hooks:
7-
- id: black
8-
7+
- id: black
8+
- repo: https://github.com/pycqa/flake8
9+
rev: 7.1.1
10+
hooks:
11+
- id: flake8

CHANGELOG.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
1.0
22
1.0 will be a complete api overhaul
33

4+
0.12.2
5+
* Support Python 3.13 via `legacy-cgi` package.
6+
Thank you, https://github.com/Dryusdan.
7+
See:
8+
https://github.com/jvanasco/metadata_parser/pull/44
9+
https://github.com/jvanasco/metadata_parser/issues/43
10+
* updated pre-commit-config
411

512
0.12.1
613
* typing

setup.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
re.compile(r'.*__VERSION__ = "(.*?)"', re.S).match(v_file.read()).group(1)
2121
) # noqa: E501
2222

23-
long_description = (
24-
description
25-
) = "A module to parse metadata out of urls and html documents"
23+
long_description = description = (
24+
"A module to parse metadata out of urls and html documents"
25+
)
2626
with open(os.path.join(HERE, "README.rst")) as fp:
2727
long_description = fp.read()
2828

@@ -34,7 +34,7 @@
3434
if sys.version_info.major == 2:
3535
requires.append("backports.html")
3636

37-
if sys.version_info >= (3,13):
37+
if sys.version_info >= (3, 13):
3838
requires.append("legacy-cgi")
3939

4040
tests_require = [
@@ -66,6 +66,7 @@
6666
"Programming Language :: Python :: 3.10",
6767
"Programming Language :: Python :: 3.11",
6868
"Programming Language :: Python :: 3.12",
69+
"Programming Language :: Python :: 3.13",
6970
"Topic :: Text Processing :: Markup :: HTML",
7071
"Topic :: Software Development :: Libraries :: Python Modules",
7172
],

src/metadata_parser/__init__.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,9 @@ def warn_user(message: str) -> None:
188188
# not testing ipv6 right now, because rules are needed for ensuring they
189189
# are correct
190190
RE_VALID_NETLOC = re.compile(
191-
r"(?:" r"(?P<ipv4>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})" r"|" # ...or ipv4
191+
r"(?:"
192+
r"(?P<ipv4>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})"
193+
r"|" # ...or ipv4
192194
# r'(?P<ipv6>\[?[A-F0-9]*:[A-F0-9:]+\]?)' # ...or ipv6
193195
# r'|'
194196
r"(?P<localhost>localhost)" # localhost...
@@ -1008,9 +1010,9 @@ class ParsedResult(object):
10081010

10091011
metadata: Dict
10101012
soup: Optional[BeautifulSoup] = None
1011-
response_history: Optional[
1012-
ResponseHistory
1013-
] = None # only stashing `ResponseHistory` if we have it
1013+
response_history: Optional[ResponseHistory] = (
1014+
None # only stashing `ResponseHistory` if we have it
1015+
)
10141016
_version: int = 1 # version tracking
10151017
default_encoder: Optional[Callable] = None
10161018

@@ -1882,9 +1884,9 @@ def _run_in_session(_requests_session: requests.Session):
18821884
(k.lower(), v) for k, v in resp.headers.items()
18831885
)
18841886
# stash this into the url actual too
1885-
self.url_actual = self.parsed_result.metadata["_internal"][
1886-
"url_actual"
1887-
] = resp.url
1887+
self.url_actual = self.parsed_result.metadata["_internal"]["url_actual"] = (
1888+
resp.url
1889+
)
18881890
# stash the encoding
18891891
self.parsed_result.metadata["_internal"]["encoding"] = html_encoding = (
18901892
resp.encoding.lower() if resp.encoding else None

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
envlist =
33
lint,
44
mypy,
5-
py36,py37,py38,py39,py310,py311,py312
5+
py36,py37,py38,py39,py310,py311,py312,py313
66

77
[testenv]
88
commands =

0 commit comments

Comments
 (0)