Skip to content

Commit

Permalink
Merge branch 'release/1.14.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamDumpleton committed May 2, 2022
2 parents 77634fa + 97b72d4 commit f2f1a68
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 21 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,9 @@ jobs:
strategy:
matrix:
python:
- {os: ubuntu-latest, python-version: 3.6, pyver: py36}
- {os: ubuntu-latest, python-version: 3.7, pyver: py37}
- {os: ubuntu-latest, python-version: 3.8, pyver: py38}
- {os: ubuntu-latest, python-version: 3.9, pyver: py39}
#- {os: ubuntu-latest, python-version: 3.7, pyver: py37}
#- {os: ubuntu-latest, python-version: 3.8, pyver: py38}
#- {os: ubuntu-latest, python-version: 3.9, pyver: py39}
- {os: ubuntu-latest, python-version: "3.10", pyver: py310}
env:
py: python${{ matrix.python.python-version }}
Expand Down Expand Up @@ -245,7 +244,7 @@ jobs:
if: ${{ matrix.arch == 'aarch64' }}
uses: docker/setup-qemu-action@v1
- name: Build wheels
uses: pypa/cibuildwheel@v2.3.1
uses: pypa/cibuildwheel@v2.4.0
with:
output-dir: dist
env:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2013-2019, Graham Dumpleton
Copyright (c) 2013-2022, Graham Dumpleton
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
34 changes: 23 additions & 11 deletions docs/changes.rst
Original file line number Diff line number Diff line change
@@ -1,31 +1,43 @@
Release Notes
=============

Version 1.14.1
--------------

**Bugs Fixed**

* When the post import hooks mechanism was being used, and a Python package with
its own custom module importer was used, importing modules could fail if the
custom module importer didn't use the latest Python import hook finder/loader
APIs and instead used the deprecated API. This was actually occurring with the
`zipimporter` in Python itself, which was not updated to use the newer Python
APIs until Python 3.10.

Version 1.14.0
--------------

**Bugs Fixed**

* Python 3.11 dropped `inspect.formatargspec()` which was used in creating
* Python 3.11 dropped ``inspect.formatargspec()`` which was used in creating
signature changing decorators. Now bundling a version of this function
which uses `Parameter` and `Signature` from `inspect` module when available.
The replacement function is exposed as `wrapt.formatargspec()` if need it
for your own code.
which uses ``Parameter`` and ``Signature`` from ``inspect`` module when
available. The replacement function is exposed as ``wrapt.formatargspec()``
if need it for your own code.

* When using a decorator on a class, `isinstance()` checks wouldn't previously
work as expected and you had to manually use `Type.__wrapped__` to access
the real type when doing instance checks. The `__instancecheck__` hook is now
implemented such that you don't have to use `Type.__wrapped__` instead of
`Type` as last argument to `isinstance()`.
* When using a decorator on a class, ``isinstance()`` checks wouldn't previously
work as expected and you had to manually use ``Type.__wrapped__`` to access
the real type when doing instance checks. The ``__instancecheck__`` hook is
now implemented such that you don't have to use ``Type.__wrapped__`` instead
of ``Type`` as last argument to ``isinstance()``.

* Eliminated deprecation warnings related to Python module import system, which
would have turned into broken code in Python 3.12. This was used by the post
import hook mechanism.

**New Features**

* Binary wheels provided on PyPi for `aarch64` Linux systems and macOS
native silicon where supported by Python when using `pypa/cibuildwheel`.
* Binary wheels provided on PyPi for ``aarch64`` Linux systems and macOS
native silicon where supported by Python when using ``pypa/cibuildwheel``.

Version 1.13.3
--------------
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: Implementation :: PyPy
project_urls =
Expand Down
2 changes: 1 addition & 1 deletion src/wrapt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version_info__ = ('1', '14', '0')
__version_info__ = ('1', '14', '1')
__version__ = '.'.join(__version_info__)

from .wrappers import (ObjectProxy, CallableObjectProxy, FunctionWrapper,
Expand Down
13 changes: 10 additions & 3 deletions src/wrapt/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,14 @@ class _ImportHookChainedLoader:
def __init__(self, loader):
self.loader = loader

def load_module(self, fullname):
if hasattr(loader, "load_module"):
self.load_module = self._load_module
if hasattr(loader, "create_module"):
self.create_module = self._create_module
if hasattr(loader, "exec_module"):
self.exec_module = self._exec_module

def _load_module(self, fullname):
module = self.loader.load_module(fullname)
notify_module_loaded(module)

Expand All @@ -162,10 +169,10 @@ def load_module(self, fullname):
# Python 3.4 introduced create_module() and exec_module() instead of
# load_module() alone. Splitting the two steps.

def create_module(self, spec):
def _create_module(self, spec):
return self.loader.create_module(spec)

def exec_module(self, module):
def _exec_module(self, module):
self.loader.exec_module(module)
notify_module_loaded(module)

Expand Down

0 comments on commit f2f1a68

Please sign in to comment.