Skip to content

Commit e9487e7

Browse files
authored
Release 3.13 (#215)
3.13.0 (2025-02-06) ------------------- **Removed** - Dependency on `idna`. Since qh3 version 1.4, we can rely on their internal idna encoder that does not require any external dependencies. This change does not affect the feature on international domain names. If `idna` is installed, it will be used instead. - Dependency on `kiss-headers`. We decided to vendor kiss-headers into Niquests for several reasons. The principal one is that the project is stable and require next to no maintenance. And pulling extra dependencies affect some end-users. We are in the process of measuring potential interest for kiss-headers models. We may decide to remove its support completely in a next major version.
2 parents da52870 + 1ce0d46 commit e9487e7

33 files changed

+4088
-8743
lines changed

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
exclude: 'docs/|ext/'
1+
exclude: 'docs/|src/niquests/_vendor'
22

33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
@@ -23,4 +23,4 @@ repos:
2323
- id: mypy
2424
args: [--check-untyped-defs]
2525
exclude: 'tests/|noxfile.py'
26-
additional_dependencies: ['charset_normalizer', 'urllib3.future>=2.12.900', 'wassima>=1.0.1', 'idna', 'kiss_headers', 'qh3>=1.3']
26+
additional_dependencies: ['charset_normalizer', 'urllib3.future>=2.12.900', 'wassima>=1.0.1', 'qh3>=1.4']

HISTORY.md

+11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
Release History
22
===============
33

4+
3.13.0 (2025-02-06)
5+
-------------------
6+
7+
**Removed**
8+
- Dependency on `idna`. Since qh3 version 1.4, we can rely on their internal idna encoder that does not require any external dependencies.
9+
This change does not affect the feature on international domain names. If `idna` is installed, it will be used instead.
10+
- Dependency on `kiss-headers`. We decided to vendor kiss-headers into Niquests for several reasons. The principal one
11+
is that the project is stable and require next to no maintenance. And pulling extra dependencies affect some end-users.
12+
We are in the process of measuring potential interest for kiss-headers models. We may decide to remove its support completely
13+
in a next major version.
14+
415
3.12.3 (2025-01-28)
516
-------------------
617

ext/LICENSE

-1
This file was deleted.

ext/flower-of-life.jpg

-14.5 KB
Binary file not shown.

ext/kr-compressed.png

-5.81 KB
Binary file not shown.

ext/kr.png

-9.24 KB
Binary file not shown.

ext/psf-compressed.png

-11.7 KB
Binary file not shown.

ext/psf.png

-14.2 KB
Binary file not shown.

ext/requests-logo-compressed.png

-188 KB
Binary file not shown.

ext/requests-logo.ai

-8,722
This file was deleted.

ext/requests-logo.png

-188 KB
Binary file not shown.

ext/requests-logo.svg

-1
This file was deleted.

ext/ss-compressed.png

-363 KB
Binary file not shown.

ext/ss.png

-363 KB
Binary file not shown.

pyproject.toml

-2
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,8 @@ requires-python = ">=3.7"
4141
dynamic = ["version"]
4242
dependencies = [
4343
"charset_normalizer>=2,<4",
44-
"idna>=2.5,<4",
4544
"urllib3.future>=2.12.900,<3",
4645
"wassima>=1.0.1,<2",
47-
"kiss_headers>=2,<4",
4846
]
4947

5048
[project.optional-dependencies]

src/niquests/__version__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
__url__: str = "https://niquests.readthedocs.io"
1010

1111
__version__: str
12-
__version__ = "3.12.3"
12+
__version__ = "3.13.0"
1313

14-
__build__: int = 0x031203
14+
__build__: int = 0x031300
1515
__author__: str = "Kenneth Reitz"
1616
__author_email__: str = "me@kennethreitz.org"
1717
__license__: str = "Apache-2.0"

src/niquests/_typing.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
from http.cookiejar import CookieJar
55
from os import PathLike
66

7-
from kiss_headers import Headers
8-
97
from ._compat import HAS_LEGACY_URLLIB3
8+
from ._vendor.kiss_headers import Headers
109

1110
if HAS_LEGACY_URLLIB3 is False:
1211
from urllib3 import AsyncResolverDescription, ResolverDescription, Retry, Timeout

src/niquests/_vendor/__init__.py

Whitespace-only changes.
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 TAHRI Ahmed R.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
"""
2+
Kiss-Headers
3+
~~~~~~~~~~~~~~
4+
5+
Kiss-Headers is a headers, HTTP or IMAP4 _(message, email)_ flavour, utility, written in pure Python, for humans.
6+
Object oriented headers. Keep it sweet and simple.
7+
Basic usage:
8+
9+
>>> import requests
10+
>>> from kiss_headers import parse_it
11+
>>> r = requests.get('https://www.python.org')
12+
>>> headers = parse_it(r)
13+
>>> 'charset' in headers.content_type
14+
True
15+
>>> headers.content_type.charset
16+
'utf-8'
17+
>>> 'text/html' in headers.content_type
18+
True
19+
>>> headers.content_type == 'text/html'
20+
True
21+
>>> headers -= 'content-type'
22+
>>> 'Content-Type' in headers
23+
False
24+
25+
... or from a raw IMAP4 message:
26+
27+
>>> message = requests.get("https://gist.githubusercontent.com/Ousret/8b84b736c375bb6aa3d389e86b5116ec/raw/21cb2f7af865e401c37d9b053fb6fe1abf63165b/sample-message.eml").content
28+
>>> headers = parse_it(message)
29+
>>> 'Sender' in headers
30+
True
31+
32+
Others methods and usages are available - see the full documentation
33+
at <https://github.com/jawah/kiss-headers>.
34+
35+
:copyright: (c) 2020 by Ahmed TAHRI
36+
:license: MIT, see LICENSE for more details.
37+
"""
38+
39+
from __future__ import annotations
40+
41+
from .api import dumps, explain, get_polymorphic, parse_it
42+
from .builder import (
43+
Accept,
44+
AcceptEncoding,
45+
AcceptLanguage,
46+
Allow,
47+
AltSvc,
48+
Authorization,
49+
BasicAuthorization,
50+
CacheControl,
51+
Connection,
52+
ContentDisposition,
53+
ContentEncoding,
54+
ContentLength,
55+
ContentRange,
56+
ContentSecurityPolicy,
57+
ContentType,
58+
CrossOriginResourcePolicy,
59+
CustomHeader,
60+
Date,
61+
Digest,
62+
Dnt,
63+
Etag,
64+
Expires,
65+
Forwarded,
66+
From,
67+
Host,
68+
IfMatch,
69+
IfModifiedSince,
70+
IfNoneMatch,
71+
IfUnmodifiedSince,
72+
KeepAlive,
73+
LastModified,
74+
Location,
75+
ProxyAuthorization,
76+
Referer,
77+
ReferrerPolicy,
78+
RetryAfter,
79+
Server,
80+
SetCookie,
81+
StrictTransportSecurity,
82+
TransferEncoding,
83+
UpgradeInsecureRequests,
84+
UserAgent,
85+
Vary,
86+
WwwAuthenticate,
87+
XContentTypeOptions,
88+
XDnsPrefetchControl,
89+
XFrameOptions,
90+
XXssProtection,
91+
)
92+
from .models import Attributes, Header, Headers, lock_output_type
93+
from .serializer import decode, encode
94+
from .version import VERSION, __version__
95+
96+
__all__ = (
97+
"dumps",
98+
"explain",
99+
"get_polymorphic",
100+
"parse_it",
101+
"Attributes",
102+
"Header",
103+
"Headers",
104+
"lock_output_type",
105+
"decode",
106+
"encode",
107+
"VERSION",
108+
"__version__",
109+
"Accept",
110+
"AcceptEncoding",
111+
"AcceptLanguage",
112+
"Allow",
113+
"AltSvc",
114+
"Authorization",
115+
"BasicAuthorization",
116+
"CacheControl",
117+
"Connection",
118+
"ContentDisposition",
119+
"ContentEncoding",
120+
"ContentLength",
121+
"ContentRange",
122+
"ContentSecurityPolicy",
123+
"ContentType",
124+
"CrossOriginResourcePolicy",
125+
"CustomHeader",
126+
"Date",
127+
"Digest",
128+
"Dnt",
129+
"Etag",
130+
"Expires",
131+
"Forwarded",
132+
"From",
133+
"Host",
134+
"IfMatch",
135+
"IfModifiedSince",
136+
"IfNoneMatch",
137+
"IfUnmodifiedSince",
138+
"KeepAlive",
139+
"LastModified",
140+
"Location",
141+
"ProxyAuthorization",
142+
"Referer",
143+
"ReferrerPolicy",
144+
"RetryAfter",
145+
"Server",
146+
"SetCookie",
147+
"StrictTransportSecurity",
148+
"TransferEncoding",
149+
"UpgradeInsecureRequests",
150+
"UserAgent",
151+
"Vary",
152+
"WwwAuthenticate",
153+
"XContentTypeOptions",
154+
"XDnsPrefetchControl",
155+
"XFrameOptions",
156+
"XXssProtection",
157+
)

0 commit comments

Comments
 (0)