Skip to content

Commit

Permalink
Release 3.13 (#215)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Ousret authored Feb 6, 2025
2 parents da52870 + 1ce0d46 commit e9487e7
Show file tree
Hide file tree
Showing 33 changed files with 4,088 additions and 8,743 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
exclude: 'docs/|ext/'
exclude: 'docs/|src/niquests/_vendor'

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand All @@ -23,4 +23,4 @@ repos:
- id: mypy
args: [--check-untyped-defs]
exclude: 'tests/|noxfile.py'
additional_dependencies: ['charset_normalizer', 'urllib3.future>=2.12.900', 'wassima>=1.0.1', 'idna', 'kiss_headers', 'qh3>=1.3']
additional_dependencies: ['charset_normalizer', 'urllib3.future>=2.12.900', 'wassima>=1.0.1', 'qh3>=1.4']
11 changes: 11 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
Release History
===============

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.

3.12.3 (2025-01-28)
-------------------

Expand Down
1 change: 0 additions & 1 deletion ext/LICENSE

This file was deleted.

Binary file removed ext/flower-of-life.jpg
Binary file not shown.
Binary file removed ext/kr-compressed.png
Binary file not shown.
Binary file removed ext/kr.png
Binary file not shown.
Binary file removed ext/psf-compressed.png
Binary file not shown.
Binary file removed ext/psf.png
Binary file not shown.
Binary file removed ext/requests-logo-compressed.png
Binary file not shown.
8,722 changes: 0 additions & 8,722 deletions ext/requests-logo.ai

This file was deleted.

Binary file removed ext/requests-logo.png
Binary file not shown.
1 change: 0 additions & 1 deletion ext/requests-logo.svg

This file was deleted.

Binary file removed ext/ss-compressed.png
Binary file not shown.
Binary file removed ext/ss.png
Binary file not shown.
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ requires-python = ">=3.7"
dynamic = ["version"]
dependencies = [
"charset_normalizer>=2,<4",
"idna>=2.5,<4",
"urllib3.future>=2.12.900,<3",
"wassima>=1.0.1,<2",
"kiss_headers>=2,<4",
]

[project.optional-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions src/niquests/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
__url__: str = "https://niquests.readthedocs.io"

__version__: str
__version__ = "3.12.3"
__version__ = "3.13.0"

__build__: int = 0x031203
__build__: int = 0x031300
__author__: str = "Kenneth Reitz"
__author_email__: str = "[email protected]"
__license__: str = "Apache-2.0"
Expand Down
3 changes: 1 addition & 2 deletions src/niquests/_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
from http.cookiejar import CookieJar
from os import PathLike

from kiss_headers import Headers

from ._compat import HAS_LEGACY_URLLIB3
from ._vendor.kiss_headers import Headers

if HAS_LEGACY_URLLIB3 is False:
from urllib3 import AsyncResolverDescription, ResolverDescription, Retry, Timeout
Expand Down
Empty file.
21 changes: 21 additions & 0 deletions src/niquests/_vendor/kiss_headers/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 TAHRI Ahmed R.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
157 changes: 157 additions & 0 deletions src/niquests/_vendor/kiss_headers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
"""
Kiss-Headers
~~~~~~~~~~~~~~
Kiss-Headers is a headers, HTTP or IMAP4 _(message, email)_ flavour, utility, written in pure Python, for humans.
Object oriented headers. Keep it sweet and simple.
Basic usage:
>>> import requests
>>> from kiss_headers import parse_it
>>> r = requests.get('https://www.python.org')
>>> headers = parse_it(r)
>>> 'charset' in headers.content_type
True
>>> headers.content_type.charset
'utf-8'
>>> 'text/html' in headers.content_type
True
>>> headers.content_type == 'text/html'
True
>>> headers -= 'content-type'
>>> 'Content-Type' in headers
False
... or from a raw IMAP4 message:
>>> message = requests.get("https://gist.githubusercontent.com/Ousret/8b84b736c375bb6aa3d389e86b5116ec/raw/21cb2f7af865e401c37d9b053fb6fe1abf63165b/sample-message.eml").content
>>> headers = parse_it(message)
>>> 'Sender' in headers
True
Others methods and usages are available - see the full documentation
at <https://github.com/jawah/kiss-headers>.
:copyright: (c) 2020 by Ahmed TAHRI
:license: MIT, see LICENSE for more details.
"""

from __future__ import annotations

from .api import dumps, explain, get_polymorphic, parse_it
from .builder import (
Accept,
AcceptEncoding,
AcceptLanguage,
Allow,
AltSvc,
Authorization,
BasicAuthorization,
CacheControl,
Connection,
ContentDisposition,
ContentEncoding,
ContentLength,
ContentRange,
ContentSecurityPolicy,
ContentType,
CrossOriginResourcePolicy,
CustomHeader,
Date,
Digest,
Dnt,
Etag,
Expires,
Forwarded,
From,
Host,
IfMatch,
IfModifiedSince,
IfNoneMatch,
IfUnmodifiedSince,
KeepAlive,
LastModified,
Location,
ProxyAuthorization,
Referer,
ReferrerPolicy,
RetryAfter,
Server,
SetCookie,
StrictTransportSecurity,
TransferEncoding,
UpgradeInsecureRequests,
UserAgent,
Vary,
WwwAuthenticate,
XContentTypeOptions,
XDnsPrefetchControl,
XFrameOptions,
XXssProtection,
)
from .models import Attributes, Header, Headers, lock_output_type
from .serializer import decode, encode
from .version import VERSION, __version__

__all__ = (
"dumps",
"explain",
"get_polymorphic",
"parse_it",
"Attributes",
"Header",
"Headers",
"lock_output_type",
"decode",
"encode",
"VERSION",
"__version__",
"Accept",
"AcceptEncoding",
"AcceptLanguage",
"Allow",
"AltSvc",
"Authorization",
"BasicAuthorization",
"CacheControl",
"Connection",
"ContentDisposition",
"ContentEncoding",
"ContentLength",
"ContentRange",
"ContentSecurityPolicy",
"ContentType",
"CrossOriginResourcePolicy",
"CustomHeader",
"Date",
"Digest",
"Dnt",
"Etag",
"Expires",
"Forwarded",
"From",
"Host",
"IfMatch",
"IfModifiedSince",
"IfNoneMatch",
"IfUnmodifiedSince",
"KeepAlive",
"LastModified",
"Location",
"ProxyAuthorization",
"Referer",
"ReferrerPolicy",
"RetryAfter",
"Server",
"SetCookie",
"StrictTransportSecurity",
"TransferEncoding",
"UpgradeInsecureRequests",
"UserAgent",
"Vary",
"WwwAuthenticate",
"XContentTypeOptions",
"XDnsPrefetchControl",
"XFrameOptions",
"XXssProtection",
)
Loading

0 comments on commit e9487e7

Please sign in to comment.