Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: pytest-dev/pluggy
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.7.1
Choose a base ref
...
head repository: pytest-dev/pluggy
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0.8.0
Choose a head ref

Commits on Jul 27, 2018

  1. Add Gitter badge

    gitter-badger committed Jul 27, 2018
    Copy the full SHA
    9555f4f View commit details
  2. Copy the full SHA
    d044159 View commit details
  3. Use "pluggy" in changelog title

    (btw sorry to push branches directly to the repo, I'm in a hurry so I'm doing this using the GH UI).
    nicoddemus authored Jul 27, 2018
    Copy the full SHA
    53af86d View commit details
  4. Fix Gitter badge

    nicoddemus authored Jul 27, 2018
    Copy the full SHA
    8b95e0f View commit details
  5. Merge pull request #163 from pytest-dev/pluggy-changelog-titles

    Use "pluggy" in changelog title
    nicoddemus authored Jul 27, 2018
    Copy the full SHA
    c1f6616 View commit details

Commits on Jul 28, 2018

  1. Merge pull request #161 from gitter-badger/gitter-badge

    Add a Gitter chat badge to README.rst
    nicoddemus authored Jul 28, 2018
    Copy the full SHA
    9433325 View commit details
  2. Merge pull request #162 from pytest-dev/nicoddemus-patch-1

    Post release adjustments: skip AppVeyor
    nicoddemus authored Jul 28, 2018
    Copy the full SHA
    1b09518 View commit details
  3. Merge pull request #160 from nicoddemus/release-0.7.0

    Release 0.7.1
    nicoddemus authored Jul 28, 2018
    Copy the full SHA
    e601df4 View commit details

Commits on Jul 30, 2018

  1. Copy the full SHA
    5d37d7a View commit details
  2. Copy the full SHA
    669315c View commit details
  3. Merge pull request #168 from fschulze/changelog

    Add changelog in long package description and documentation. Fixes #165.
    nicoddemus authored Jul 30, 2018
    Copy the full SHA
    bccc385 View commit details
  4. Merge pull request #167 from nicoddemus/fix-changelog

    Normalize all titles and add dates in CHANGELOG
    nicoddemus authored Jul 30, 2018
    Copy the full SHA
    962d674 View commit details

Commits on Aug 3, 2018

  1. Copy the full SHA
    a07b424 View commit details
  2. Copy the full SHA
    c253ce2 View commit details
  3. Copy the full SHA
    e413c70 View commit details
  4. Add black badge to README

    nicoddemus committed Aug 3, 2018
    Copy the full SHA
    851a02d View commit details
  5. Copy the full SHA
    2e87aef View commit details
  6. Commit black-docs

    nicoddemus committed Aug 3, 2018
    Copy the full SHA
    98ae198 View commit details
  7. Copy the full SHA
    9940cf2 View commit details
  8. Merge pull request #169 from nicoddemus/pre-commit-black

    Add pre-commit for style checks and use black as formatter
    goodboy authored Aug 3, 2018
    Copy the full SHA
    6587ed0 View commit details

Commits on Aug 8, 2018

  1. Copy the full SHA
    96543a5 View commit details
  2. Merge pull request #173 from nicoddemus/plugin-count

    Update number of pytest plugins in the docs
    nicoddemus authored Aug 8, 2018
    Copy the full SHA
    96e94e5 View commit details
  3. Add a test demonstrating the opt in nature of args

    Args are always opt in for hookimpls regardless of whether the spec or
    call defines more then the impl accepts.
    
    Relates to #170
    Tyler Goodlet committed Aug 8, 2018
    Copy the full SHA
    429c5fc View commit details
  4. Merge pull request #172 from tgoodlet/test_opt_in_args

    Add a test demonstrating the opt in nature of args
    goodboy authored Aug 8, 2018
    Copy the full SHA
    3a79b52 View commit details

Commits on Aug 16, 2018

  1. Encapsulate spec definitions with a class

    Allows for easier introspection of spec definitions including function
    signatures and hook options. Originally introduced to address #15 and
    the accompanying PR (#43) which requires keeping track of spec default
    arguments values.
    Tyler Goodlet committed Aug 16, 2018
    Copy the full SHA
    894b5e2 View commit details

Commits on Aug 19, 2018

  1. Add trivial entry

    Tyler Goodlet committed Aug 19, 2018
    Copy the full SHA
    c967e91 View commit details
  2. Merge pull request #57 from tgoodlet/encapsulate_specs

    Encapsulate spec definitions with a class
    goodboy authored Aug 19, 2018
    Copy the full SHA
    1da70c9 View commit details

Commits on Sep 16, 2018

  1. Added get_hookimpl with test.

    victor committed Sep 16, 2018
    Copy the full SHA
    bcd551d View commit details
  2. Fixed test.

    victor committed Sep 16, 2018
    Copy the full SHA
    5e1ee95 View commit details
  3. Updated docstring.

    victor committed Sep 16, 2018
    Copy the full SHA
    17783a5 View commit details
  4. Moved get_hookimpl to HookCaller.

    victor committed Sep 16, 2018
    Copy the full SHA
    163ff50 View commit details
  5. Fixed test.

    victor committed Sep 16, 2018
    Copy the full SHA
    ca0d071 View commit details

Commits on Sep 29, 2018

  1. Refactored to use get_hookimpls()

    victor committed Sep 29, 2018
    Copy the full SHA
    e1fcf60 View commit details
  2. Inverted order, needed for calls.

    victor committed Sep 29, 2018
    Copy the full SHA
    c85f154 View commit details
  3. Copy the full SHA
    21dec08 View commit details

Commits on Sep 30, 2018

  1. Copy the full SHA
    a5c17ec View commit details

Commits on Oct 14, 2018

  1. Merge pull request #177 from Sup3rGeo/feature/get-plugins-for-hook

    Feature/get plugins for hook
    RonnyPfannschmidt authored Oct 14, 2018
    Copy the full SHA
    38988e9 View commit details

Commits on Oct 15, 2018

  1. Preparing release 0.8.0

    nicoddemus committed Oct 15, 2018
    Copy the full SHA
    758fd7c View commit details
32 changes: 32 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
repos:
- repo: https://github.com/ambv/black
rev: 18.6b4
hooks:
- id: black
args: [--safe, --quiet]
language_version: python3.6
- repo: https://github.com/asottile/blacken-docs
rev: v0.2.0
hooks:
- id: blacken-docs
additional_dependencies: [black==18.6b4]
language_version: python3.6
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v1.3.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: flake8
- repo: local
hooks:
- id: rst
name: rst
entry: rst-lint --encoding utf-8
files: ^(CHANGELOG.rst|HOWTORELEASE.rst|README.rst|changelog/.*)$
language: python
additional_dependencies: [pygments, restructuredtext_lint]
python_version: python3.6
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.0.0
hooks:
- id: rst-backticks
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ language: python
jobs:
include:
- python: '3.6'
env: TOXENV=check
env: TOXENV=linting
- python: '3.6'
env: TOXENV=docs
- python: '2.7'
64 changes: 50 additions & 14 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
pluggy 0.8.0 (2018-10-15)
=========================

Features
--------

- `#177 <https://github.com/pytest-dev/pluggy/issues/177>`_: Add ``get_hookimpls()`` method to hook callers.



Trivial/Internal Changes
------------------------

- `#165 <https://github.com/pytest-dev/pluggy/issues/165>`_: Add changelog in long package description and documentation.


- `#172 <https://github.com/pytest-dev/pluggy/issues/172>`_: Add a test exemplifying the opt-in nature of spec defined args.


- `#57 <https://github.com/pytest-dev/pluggy/issues/57>`_: Encapsulate hook specifications in a type for easier introspection.


=========
Changelog
=========

.. towncrier release notes start
pluggy 0.7.1 (2018-07-28)
=========================

@@ -69,8 +98,9 @@ pluggy 0.7.0 (Unreleased)

* `#160 <https://github.com/pytest-dev/pluggy/issues/160>`_: We discovered a deployment issue so this version was never released to PyPI, only the tag exists.

0.6.0
-----
pluggy 0.6.0 (2017-11-24)
=========================

- Add CI testing for the features, release, and master
branches of ``pytest`` (PR `#79`_).
- Document public API for ``_Result`` objects passed to wrappers
@@ -98,8 +128,9 @@ pluggy 0.7.0 (Unreleased)
.. _#103: https://github.com/pytest-dev/pluggy/pull/103


0.5.2
-----
pluggy 0.5.2 (2017-09-06)
=========================

- fix bug where ``firstresult`` wrappers were being sent an incorrectly configured
``_Result`` (a list was set instead of a single value). Add tests to check for
this as well as ``_Result.force_result()`` behaviour. Thanks to `@tgoodlet`_
@@ -116,8 +147,9 @@ pluggy 0.7.0 (Unreleased)
.. _#80: https://github.com/pytest-dev/pluggy/pull/80


0.5.1
-----
pluggy 0.5.1 (2017-08-29)
=========================

- fix a bug and add tests for case where ``firstresult`` hooks return
``None`` results. Thanks to `@RonnyPfannschmidt`_ and `@tgoodlet`_
for the issue (`#68`_) and PR (`#69`_) respectively.
@@ -126,8 +158,9 @@ pluggy 0.7.0 (Unreleased)
.. _#68: https://github.com/pytest-dev/pluggy/issues/68


0.5.0
-----
pluggy 0.5.0 (2017-08-28)
=========================

- fix bug where callbacks for historic hooks would not be called for
already registered plugins. Thanks `@vodik`_ for the PR
and `@hpk42`_ for further fixes.
@@ -185,8 +218,9 @@ pluggy 0.7.0 (Unreleased)
.. _#14: https://github.com/pytest-dev/pluggy/issues/14


0.4.0
-----
pluggy 0.4.0 (2016-09-25)
=========================

- add ``has_plugin(name)`` method to pluginmanager. thanks `@nicoddemus`_.

- fix `#11`_: make plugin parsing more resilient against exceptions
@@ -202,14 +236,16 @@ pluggy 0.7.0 (Unreleased)
.. _#4: https://github.com/pytest-dev/pluggy/issues/4


0.3.1
-----
pluggy 0.3.1 (2015-09-17)
=========================

- avoid using deprecated-in-python3.5 getargspec method. Thanks
`@mdboom`_.


0.3.0
-----
pluggy 0.3.0 (2015-05-07)
=========================

initial release

.. contributors
1 change: 0 additions & 1 deletion HOWTORELEASE.rst
Original file line number Diff line number Diff line change
@@ -21,4 +21,3 @@ Release Procedure
#. Make sure it is `available on PyPI <https://pypi.org/project/pluggy>`_.

#. Merge the PR into ``master``, either manually or using GitHub's web interface.

3 changes: 1 addition & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015 holger krekel (rather uses bitbucket/hpk42)
Copyright (c) 2015 holger krekel (rather uses bitbucket/hpk42)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -19,4 +19,3 @@ 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.

22 changes: 19 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
====================================================
pluggy - A minimalist production ready plugin system
====================================================
|pypi| |anaconda| |versions| |travis| |appveyor|

|pypi| |anaconda| |versions| |travis| |appveyor| |gitter| |black|

This is the core framework used by the `pytest`_, `tox`_, and `devpi`_ projects.

Please `read the docs`_ to learn more!

A definitive example
********************
====================
.. code-block:: python
import pluggy
@@ -20,6 +21,7 @@ A definitive example
class MySpec(object):
"""A hook specification namespace.
"""
@hookspec
def myhook(self, arg1, arg2):
"""My special little hook that you can customize.
@@ -29,6 +31,7 @@ A definitive example
class Plugin_1(object):
"""A hook implementation namespace.
"""
@hookimpl
def myhook(self, arg1, arg2):
print("inside Plugin_1.myhook()")
@@ -38,6 +41,7 @@ A definitive example
class Plugin_2(object):
"""A 2nd hook implementation namespace.
"""
@hookimpl
def myhook(self, arg1, arg2):
print("inside Plugin_2.myhook()")
@@ -52,23 +56,35 @@ A definitive example
pm.register(Plugin_1())
pm.register(Plugin_2())
# call our `myhook` hook
# call our ``myhook`` hook
results = pm.hook.myhook(arg1=1, arg2=2)
print(results)
.. badges
.. |pypi| image:: https://img.shields.io/pypi/v/pluggy.svg
:target: https://pypi.org/pypi/pluggy

.. |versions| image:: https://img.shields.io/pypi/pyversions/pluggy.svg
:target: https://pypi.org/pypi/pluggy

.. |travis| image:: https://img.shields.io/travis/pytest-dev/pluggy/master.svg
:target: https://travis-ci.org/pytest-dev/pluggy

.. |appveyor| image:: https://img.shields.io/appveyor/ci/pytestbot/pluggy/master.svg
:target: https://ci.appveyor.com/project/pytestbot/pluggy

.. |anaconda| image:: https://anaconda.org/conda-forge/pluggy/badges/version.svg
:target: https://anaconda.org/conda-forge/pluggy

.. |gitter| image:: https://badges.gitter.im/pytest-dev/pluggy.svg
:alt: Join the chat at https://gitter.im/pytest-dev/pluggy
:target: https://gitter.im/pytest-dev/pluggy?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge

.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/ambv/black

.. links
.. _pytest:
http://pytest.org
6 changes: 5 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
environment:
matrix:
# note: please use "tox --listenvs" to populate the build matrix below
- TOXENV: "check"
- TOXENV: "linting"
- TOXENV: "docs"
- TOXENV: "py27-pytestrelease"
- TOXENV: "py34-pytestrelease"
@@ -32,3 +32,7 @@ build: false # Not a C# project, build stuff at the test step instead.

test_script:
- C:\Python35\python -m tox

# We don't deploy anything on tags with AppVeyor, we use Travis instead, so we
# might as well save resources
skip_tags: true
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.. include:: ../CHANGELOG.rst
65 changes: 34 additions & 31 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -3,57 +3,54 @@


extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.coverage',
'sphinx.ext.viewcode',
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
"sphinx.ext.intersphinx",
"sphinx.ext.coverage",
"sphinx.ext.viewcode",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

source_suffix = '.rst'
source_suffix = ".rst"

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# General information about the project.

dist = pkg_resources.get_distribution('pluggy')
dist = pkg_resources.get_distribution("pluggy")
project = dist.project_name
copyright = u'2016, Holger Krekel'
author = 'Holger Krekel'
copyright = u"2016, Holger Krekel"
author = "Holger Krekel"

release = dist.version
# The short X.Y version.
version = u'.'.join(dist.version.split('.')[:2])
version = u".".join(dist.version.split(".")[:2])


language = None

pygments_style = 'sphinx'
html_logo = '_static/img/plug.png'
html_theme = 'alabaster'
pygments_style = "sphinx"
html_logo = "_static/img/plug.png"
html_theme = "alabaster"
html_theme_options = {
# 'logo': 'img/plug.png',
# 'logo_name': 'true',
'description': 'The `pytest` plugin system',
'github_user': 'pytest-dev',
'github_repo': 'pluggy',
'github_button': 'true',
'github_banner': 'true',
'page_width': '1080px',
'fixed_sidebar': 'false',
"description": "The `pytest` plugin system",
"github_user": "pytest-dev",
"github_repo": "pluggy",
"github_button": "true",
"github_banner": "true",
"page_width": "1080px",
"fixed_sidebar": "false",
}
html_static_path = ['_static']
html_static_path = ["_static"]

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'pluggy', u'pluggy Documentation',
[author], 1)
]
man_pages = [(master_doc, "pluggy", u"pluggy Documentation", [author], 1)]


# -- Options for Texinfo output -------------------------------------------
@@ -62,10 +59,16 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'pluggy', u'pluggy Documentation',
author, 'pluggy', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
"pluggy",
u"pluggy Documentation",
author,
"pluggy",
"One line description of project.",
"Miscellaneous",
)
]

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
intersphinx_mapping = {"https://docs.python.org/": None}
4 changes: 3 additions & 1 deletion docs/examples/eggsample-spam/eggsample_spam.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import eggsample


@eggsample.hookimpl
def eggsample_add_ingredients(ingredients):
"""Here the caller expects us to return a list."""
@@ -9,12 +10,13 @@ def eggsample_add_ingredients(ingredients):
spam = ["splendiferous spam", "magnificent spam"]
return spam


@eggsample.hookimpl
def eggsample_prep_condiments(condiments):
"""Here the caller passes a mutable object, so we mess with it directly."""
try:
del condiments["steak sauce"]
except KeyError:
pass
condiments['spam sauce'] = 42
condiments["spam sauce"] = 42
return f"Now this is what I call a condiments tray!"
Loading