Skip to content

Commit 1332d2d

Browse files
Merge branch 'release/2.1.1'
2 parents 0febe4a + 3041f58 commit 1332d2d

File tree

5 files changed

+32
-11
lines changed

5 files changed

+32
-11
lines changed

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
include README.md
22
include RELEASE.rst
33
include LICENSE
4+
include tox.ini
45

56
recursive-include src *.c *.pyi py.typed
67
recursive-include tests *.py *.out

docs/changes.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
Release Notes
22
=============
33

4+
Version 2.1.1
5+
-------------
6+
7+
**Bugs Fixed**
8+
9+
* Search field for documentation hosted on Read the Docs wasn't working
10+
correctly due to JavaScript error.
11+
12+
* Missing ``tox.ini`` from source distribution package has been added.
13+
414
Version 2.1.0
515
-------------
616

docs/conf.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
# The short X.Y version.
5050
version = "2.1"
5151
# The full version, including alpha/beta/rc tags.
52-
release = "2.1.0"
52+
release = "2.1.1"
5353

5454
# The language for content autogenerated by Sphinx. Refer to documentation
5555
# for a list of supported languages.
@@ -172,6 +172,10 @@
172172
# Output file base name for HTML help builder.
173173
htmlhelp_basename = "wraptdoc"
174174

175+
# Ensure jQuery is included for search functionality
176+
html_js_files = [
177+
"https://code.jquery.com/jquery-3.7.1.min.js",
178+
]
175179

176180
# -- Options for LaTeX output --------------------------------------------------
177181

docs/decorators.rst

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -654,15 +654,21 @@ When calling the wrapped function in the decorator wrapper function, the
654654
instance is already bound to ``wrapped`` and will be passed automatically
655655
as the first argument to the original wrapped function.
656656

657-
Note that due to a bug in ``classmethod.__get__()`` prior to Python 3.9,
658-
whereby it does not apply the descriptor protocol to the function wrapped
659-
by ``@classmethod``, the above only applies where the decorator wraps the
660-
``@classmethod`` decorator. If the decorator is placed inside of the
661-
``@classmethod`` decorator, then ``instance`` will be ``None`` and the
662-
decorator wrapper function will see the call as being the same as a normal
663-
function. As a result, always place any decorator outside of the
664-
``@classmethod`` decorator if needing the code to be portable to versions
665-
of Python older than Python 3.9.
657+
Note that you should always apply the decorator outside of the ``@classmethod``
658+
decorator. This is because the ``@classmethod`` decorator itself is not
659+
aware of the descriptor protocol for the function it is wrapping, and so
660+
it does not apply it. If the decorator is placed inside of the ``@classmethod``
661+
decorator, then ``instance`` will be ``None`` and the decorator wrapper function
662+
will see the call as being the same as a normal function.
663+
664+
This behavour of ``@classmethod`` is a bug in it's ``classmethod.__get__()``
665+
implementation. The bug existed prior to Python 3.9 and was fixed in that
666+
version of Python, however in Python 3.13 this fix in Python was reverted back
667+
to the old behaviour because various third party code relied on the broken
668+
behaviour and even though technically not correct, it was deemed safer to revert
669+
the fix. Thus the general recommendation remains that decorators implemented
670+
using ``@wrapt.decorator`` always be placed outside of ``@classmethod`` and
671+
never inside.
666672

667673
Decorating Static Methods
668674
-------------------------

src/wrapt/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Wrapt is a library for decorators, wrappers and monkey patching.
33
"""
44

5-
__version_info__ = ("2", "1", "0")
5+
__version_info__ = ("2", "1", "1")
66
__version__ = ".".join(__version_info__)
77

88
from .__wrapt__ import (

0 commit comments

Comments
 (0)