diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 6befc974..df8f41f3 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,74 @@ +pluggy 0.7.1 (2018-07-28) +========================= + +Deprecations and Removals +------------------------- + +- `#116 `_: Deprecate the ``implprefix`` kwarg to ``PluginManager`` and instead + expect users to start using explicit ``HookimplMarker`` everywhere. + + + +Features +-------- + +- `#122 `_: Add ``.plugin`` member to ``PluginValidationError`` to access failing plugin during post-mortem. + + +- `#138 `_: Add per implementation warnings support for hookspecs allowing for both + deprecation and future warnings of legacy and (future) experimental hooks + respectively. + + + +Bug Fixes +--------- + +- `#110 `_: Fix a bug where ``_HookCaller.call_historic()`` would call the ``proc`` + arg even when the default is ``None`` resulting in a ``TypeError``. + +- `#160 `_: Fix problem when handling ``VersionConflict`` errors when loading setuptools plugins. + + + +Improved Documentation +---------------------- + +- `#123 `_: Document how exceptions are handled and how the hook call loop + terminates immediately on the first error which is then delivered + to any surrounding wrappers. + + +- `#136 `_: Docs rework including a much better introduction and comprehensive example + set for new users. A big thanks goes out to @obestwalter for the great work! + + + +Trivial/Internal Changes +------------------------ + +- `#117 `_: Break up the main monolithic package modules into separate modules by concern + + +- `#131 `_: Automate ``setuptools`` wheels building and PyPi upload using TravisCI. + + +- `#153 `_: Reorganize tests more appropriately by modules relating to each + internal component/feature. This is in an effort to avoid (future) + duplication and better separation of concerns in the test set. + + +- `#156 `_: Add ``HookImpl.__repr__()`` for better debugging. + + +- `#66 `_: Start using ``towncrier`` and a custom ``tox`` environment to prepare releases! + + +pluggy 0.7.0 (Unreleased) +========================= + +* `#160 `_: We discovered a deployment issue so this version was never released to PyPI, only the tag exists. + 0.6.0 ----- - Add CI testing for the features, release, and master diff --git a/changelog/110.bugfix.rst b/changelog/110.bugfix.rst deleted file mode 100644 index 31592bfc..00000000 --- a/changelog/110.bugfix.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix a bug where ``_HookCaller.call_historic()`` would call the ``proc`` -arg even when the default is ``None`` resulting in a ``TypeError``. diff --git a/changelog/116.removal.rst b/changelog/116.removal.rst deleted file mode 100644 index 182fc143..00000000 --- a/changelog/116.removal.rst +++ /dev/null @@ -1,2 +0,0 @@ -Deprecate the ``implprefix`` kwarg to ``PluginManager`` and instead -expect users to start using explicit ``HookimplMarker`` everywhere. diff --git a/changelog/117.trivial.rst b/changelog/117.trivial.rst deleted file mode 100644 index f6c44f19..00000000 --- a/changelog/117.trivial.rst +++ /dev/null @@ -1 +0,0 @@ -Break up the main monolithic package modules into separate modules by concern diff --git a/changelog/122.feature.rst b/changelog/122.feature.rst deleted file mode 100644 index 0f737f11..00000000 --- a/changelog/122.feature.rst +++ /dev/null @@ -1 +0,0 @@ -Add ``.plugin`` member to ``PluginValidationError`` to access failing plugin during post-mortem. diff --git a/changelog/123.doc.rst b/changelog/123.doc.rst deleted file mode 100644 index 15c9cb2a..00000000 --- a/changelog/123.doc.rst +++ /dev/null @@ -1,3 +0,0 @@ -Document how exceptions are handled and how the hook call loop -terminates immediately on the first error which is then delivered -to any surrounding wrappers. diff --git a/changelog/131.feature.rst b/changelog/131.feature.rst deleted file mode 100644 index b2b2c3ea..00000000 --- a/changelog/131.feature.rst +++ /dev/null @@ -1 +0,0 @@ -Automate ``setuptools`` wheels building and PyPi upload using TravisCI. diff --git a/changelog/136.doc.rst b/changelog/136.doc.rst deleted file mode 100644 index 83c456f6..00000000 --- a/changelog/136.doc.rst +++ /dev/null @@ -1,2 +0,0 @@ -Docs rework including a much better introduction and comprehensive example -set for new users. A big thanks goes out to @obestwalter for the great work! diff --git a/changelog/138.feature.rst b/changelog/138.feature.rst deleted file mode 100644 index 8bf4d225..00000000 --- a/changelog/138.feature.rst +++ /dev/null @@ -1,3 +0,0 @@ -Add per implementation warnings support for hookspecs allowing for both -deprecation and future warnings of legacy and (future) experimental hooks -respectively. diff --git a/changelog/153.trivial.rst b/changelog/153.trivial.rst deleted file mode 100644 index 2fdf5f3b..00000000 --- a/changelog/153.trivial.rst +++ /dev/null @@ -1,3 +0,0 @@ -Reorganize tests more appropriately by modules relating to each -internal component/feature. This is in an effort to avoid (future) -duplication and better separation of concerns in the test set. diff --git a/changelog/156.trivial.rst b/changelog/156.trivial.rst deleted file mode 100644 index 15d24994..00000000 --- a/changelog/156.trivial.rst +++ /dev/null @@ -1 +0,0 @@ -Add ``HookImpl.__repr__()`` for better debugging. diff --git a/changelog/66.feature.rst b/changelog/66.feature.rst deleted file mode 100644 index bb1476ca..00000000 --- a/changelog/66.feature.rst +++ /dev/null @@ -1 +0,0 @@ -Start using ``towncrier`` and a custom ``tox`` environment to prepare releases! diff --git a/pluggy/manager.py b/pluggy/manager.py index bc0ea608..584ce6c2 100644 --- a/pluggy/manager.py +++ b/pluggy/manager.py @@ -255,7 +255,8 @@ def load_setuptools_entrypoints(self, entrypoint_name): continue except VersionConflict as e: raise PluginValidationError( - "Plugin %r could not be loaded: %s!" % (ep.name, e)) + plugin=None, + message="Plugin %r could not be loaded: %s!" % (ep.name, e)) self.register(plugin, name=ep.name) self._plugin_distinfo.append((plugin, ep.dist)) return len(self._plugin_distinfo) diff --git a/scripts/release.py b/scripts/release.py index e28cbabd..873cb5a9 100644 --- a/scripts/release.py +++ b/scripts/release.py @@ -37,8 +37,8 @@ def pre_release(version): """Generates new docs, release announcements and creates a local tag.""" repo = create_branch(version) changelog(version, write_out=True) - repo.index.add(['CHANGELOG.rst', 'changelog']) - repo.index.commit(f"Preparing release {version}") + + check_call(['git', 'commit', '-a', '-m', f"Preparing release {version}"]) print() print(f"{Fore.GREEN}Please push your branch to your fork and open a PR.") diff --git a/testing/test_pluginmanager.py b/testing/test_pluginmanager.py index f04300be..9b56b346 100644 --- a/testing/test_pluginmanager.py +++ b/testing/test_pluginmanager.py @@ -427,6 +427,28 @@ class PseudoPlugin(object): assert pm.list_plugin_distinfo() == [(plugin, None)] +def test_load_setuptools_version_conflict(monkeypatch, pm): + """Check that we properly handle a VersionConflict problem when loading entry points""" + pkg_resources = pytest.importorskip("pkg_resources") + + def my_iter(name): + assert name == "hello" + + class EntryPoint(object): + name = "myname" + dist = None + + def load(self): + raise pkg_resources.VersionConflict('Some conflict') + + return iter([EntryPoint()]) + + monkeypatch.setattr(pkg_resources, 'iter_entry_points', my_iter) + with pytest.raises(PluginValidationError, + match="Plugin 'myname' could not be loaded: Some conflict!"): + pm.load_setuptools_entrypoints("hello") + + def test_load_setuptools_not_installed(monkeypatch, pm): monkeypatch.setitem( sys.modules, 'pkg_resources',