Skip to content

Commit c253ce2

Browse files
committed
Run pre-commit in all files
1 parent a07b424 commit c253ce2

29 files changed

+336
-252
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2015 holger krekel (rather uses bitbucket/hpk42)
3+
Copyright (c) 2015 holger krekel (rather uses bitbucket/hpk42)
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ A definitive example
5353
pm.register(Plugin_1())
5454
pm.register(Plugin_2())
5555
56-
# call our `myhook` hook
56+
# call our ``myhook`` hook
5757
results = pm.hook.myhook(arg1=1, arg2=2)
5858
print(results)
5959
@@ -68,10 +68,10 @@ A definitive example
6868
.. |appveyor| image:: https://img.shields.io/appveyor/ci/pytestbot/pluggy/master.svg
6969
:target: https://ci.appveyor.com/project/pytestbot/pluggy
7070
.. |anaconda| image:: https://anaconda.org/conda-forge/pluggy/badges/version.svg
71-
:target: https://anaconda.org/conda-forge/pluggy
71+
:target: https://anaconda.org/conda-forge/pluggy
7272
.. |gitter| image:: https://badges.gitter.im/pytest-dev/pluggy.svg
7373
:alt: Join the chat at https://gitter.im/pytest-dev/pluggy
74-
:target: https://gitter.im/pytest-dev/pluggy?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
74+
:target: https://gitter.im/pytest-dev/pluggy?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
7575

7676
.. links
7777
.. _pytest:

changelog/165.trivial.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Add changelog in long package description and documentation.
1+
Add changelog in long package description and documentation.

docs/conf.py

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,57 +3,54 @@
33

44

55
extensions = [
6-
'sphinx.ext.autodoc',
7-
'sphinx.ext.doctest',
8-
'sphinx.ext.intersphinx',
9-
'sphinx.ext.coverage',
10-
'sphinx.ext.viewcode',
6+
"sphinx.ext.autodoc",
7+
"sphinx.ext.doctest",
8+
"sphinx.ext.intersphinx",
9+
"sphinx.ext.coverage",
10+
"sphinx.ext.viewcode",
1111
]
1212

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

16-
source_suffix = '.rst'
16+
source_suffix = ".rst"
1717

1818
# The master toctree document.
19-
master_doc = 'index'
19+
master_doc = "index"
2020

2121
# General information about the project.
2222

23-
dist = pkg_resources.get_distribution('pluggy')
23+
dist = pkg_resources.get_distribution("pluggy")
2424
project = dist.project_name
25-
copyright = u'2016, Holger Krekel'
26-
author = 'Holger Krekel'
25+
copyright = u"2016, Holger Krekel"
26+
author = "Holger Krekel"
2727

2828
release = dist.version
2929
# The short X.Y version.
30-
version = u'.'.join(dist.version.split('.')[:2])
30+
version = u".".join(dist.version.split(".")[:2])
3131

3232

3333
language = None
3434

35-
pygments_style = 'sphinx'
36-
html_logo = '_static/img/plug.png'
37-
html_theme = 'alabaster'
35+
pygments_style = "sphinx"
36+
html_logo = "_static/img/plug.png"
37+
html_theme = "alabaster"
3838
html_theme_options = {
3939
# 'logo': 'img/plug.png',
4040
# 'logo_name': 'true',
41-
'description': 'The `pytest` plugin system',
42-
'github_user': 'pytest-dev',
43-
'github_repo': 'pluggy',
44-
'github_button': 'true',
45-
'github_banner': 'true',
46-
'page_width': '1080px',
47-
'fixed_sidebar': 'false',
41+
"description": "The `pytest` plugin system",
42+
"github_user": "pytest-dev",
43+
"github_repo": "pluggy",
44+
"github_button": "true",
45+
"github_banner": "true",
46+
"page_width": "1080px",
47+
"fixed_sidebar": "false",
4848
}
49-
html_static_path = ['_static']
49+
html_static_path = ["_static"]
5050

5151
# One entry per manual page. List of tuples
5252
# (source start file, name, description, authors, manual section).
53-
man_pages = [
54-
(master_doc, 'pluggy', u'pluggy Documentation',
55-
[author], 1)
56-
]
53+
man_pages = [(master_doc, "pluggy", u"pluggy Documentation", [author], 1)]
5754

5855

5956
# -- Options for Texinfo output -------------------------------------------
@@ -62,10 +59,16 @@
6259
# (source start file, target name, title, author,
6360
# dir menu entry, description, category)
6461
texinfo_documents = [
65-
(master_doc, 'pluggy', u'pluggy Documentation',
66-
author, 'pluggy', 'One line description of project.',
67-
'Miscellaneous'),
62+
(
63+
master_doc,
64+
"pluggy",
65+
u"pluggy Documentation",
66+
author,
67+
"pluggy",
68+
"One line description of project.",
69+
"Miscellaneous",
70+
)
6871
]
6972

7073
# Example configuration for intersphinx: refer to the Python standard library.
71-
intersphinx_mapping = {'https://docs.python.org/': None}
74+
intersphinx_mapping = {"https://docs.python.org/": None}

docs/examples/eggsample-spam/eggsample_spam.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import eggsample
22

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

13+
1214
@eggsample.hookimpl
1315
def eggsample_prep_condiments(condiments):
1416
"""Here the caller passes a mutable object, so we mess with it directly."""
1517
try:
1618
del condiments["steak sauce"]
1719
except KeyError:
1820
pass
19-
condiments['spam sauce'] = 42
21+
condiments["spam sauce"] = 42
2022
return f"Now this is what I call a condiments tray!"

docs/examples/eggsample-spam/setup.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
from setuptools import setup
22

3-
setup(name="eggsample-spam", install_requires="eggsample",
4-
entry_points={'eggsample': ['spam = eggsample_spam']},
5-
py_modules=['eggsample_spam'])
3+
setup(
4+
name="eggsample-spam",
5+
install_requires="eggsample",
6+
entry_points={"eggsample": ["spam = eggsample_spam"]},
7+
py_modules=["eggsample_spam"],
8+
)

docs/examples/eggsample/eggsample/hookspecs.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
hookspec = pluggy.HookspecMarker("eggsample")
44

5+
56
@hookspec
67
def eggsample_add_ingredients(ingredients: tuple):
78
"""Have a look at the ingredients and offer your own.
@@ -10,6 +11,7 @@ def eggsample_add_ingredients(ingredients: tuple):
1011
:return: a list of ingredients
1112
"""
1213

14+
1315
@hookspec
1416
def eggsample_prep_condiments(condiments: dict):
1517
"""Reorganize the condiments tray to your heart's content.

docs/examples/eggsample/eggsample/host.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,23 @@
77

88
condiments_tray = {"pickled walnuts": 13, "steak sauce": 4, "mushy peas": 2}
99

10+
1011
def main():
1112
pm = get_plugin_manager()
1213
cook = EggsellentCook(pm.hook)
1314
cook.add_ingredients()
1415
cook.prepare_the_food()
1516
cook.serve_the_food()
1617

18+
1719
def get_plugin_manager():
1820
pm = pluggy.PluginManager("eggsample")
1921
pm.add_hookspecs(hookspecs)
2022
pm.load_setuptools_entrypoints("eggsample")
2123
pm.register(lib)
2224
return pm
2325

26+
2427
class EggsellentCook:
2528
FAVORITE_INGREDIENTS = ("egg", "egg", "egg")
2629

@@ -30,7 +33,8 @@ def __init__(self, hook):
3033

3134
def add_ingredients(self):
3235
results = self.hook.eggsample_add_ingredients(
33-
ingredients=self.FAVORITE_INGREDIENTS)
36+
ingredients=self.FAVORITE_INGREDIENTS
37+
)
3438
my_ingredients = list(self.FAVORITE_INGREDIENTS)
3539
# Each hook returns a list - so we chain this list of lists
3640
other_ingredients = list(itertools.chain(*results))
@@ -41,11 +45,13 @@ def prepare_the_food(self):
4145

4246
def serve_the_food(self):
4347
condiment_comments = self.hook.eggsample_prep_condiments(
44-
condiments=condiments_tray)
48+
condiments=condiments_tray
49+
)
4550
print(f"Your food. Enjoy some {', '.join(self.ingredients)}")
4651
print(f"Some condiments? We have {', '.join(condiments_tray.keys())}")
4752
if any(condiment_comments):
4853
print("\n".join(condiment_comments))
4954

50-
if __name__ == '__main__':
55+
56+
if __name__ == "__main__":
5157
main()
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import eggsample
22

3+
34
@eggsample.hookimpl
45
def eggsample_add_ingredients():
56
spices = ["salt", "pepper"]
67
you_can_never_have_enough_eggs = ["egg", "egg"]
78
ingredients = spices + you_can_never_have_enough_eggs
89
return ingredients
910

11+
1012
@eggsample.hookimpl
1113
def eggsample_prep_condiments(condiments):
1214
condiments["mint sauce"] = 1

docs/examples/eggsample/setup.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
from setuptools import setup, find_packages
22

3-
setup(name="eggsample", install_requires="pluggy>=0.3,<1.0",
4-
entry_points={'console_scripts': ['eggsample=eggsample.host:main']},
5-
packages=find_packages())
3+
setup(
4+
name="eggsample",
5+
install_requires="pluggy>=0.3,<1.0",
6+
entry_points={"console_scripts": ["eggsample=eggsample.host:main"]},
7+
packages=find_packages(),
8+
)

0 commit comments

Comments
 (0)