diff --git a/setup.py b/setup.py index 6171755f..c7e59f9c 100644 --- a/setup.py +++ b/setup.py @@ -38,10 +38,12 @@ class sdist(_sdist): """Custom sdist building using cython """ + def run(self): # Make sure the compiled Cython files in the distribution # are up-to-date from Cython.Build import cythonize + cythonize(["src/pluggy/callers/cythonized.pyx"]) _sdist.run(self) @@ -50,12 +52,11 @@ def run(self): from Cython.Build import cythonize print("Building Cython extension(s)") exts = cythonize(["src/pluggy/callers/cythonized.pyx"]) - cmdclass['sdist'] = sdist + cmdclass["sdist"] = sdist except ImportError: # When Cython is not installed build from C sources print("Building C extension(s)") - exts = [Extension("pluggy.callers.cythonized", - ["src/pluggy/callers/cythonized.c"])] + exts = [Extension("pluggy.callers.cythonized", ["src/pluggy/callers/cythonized.c"])] def main(): @@ -74,7 +75,7 @@ def main(): install_requires=['importlib-metadata>=0.12;python_version<"3.8"'], extras_require=EXTRAS_REQUIRE, classifiers=classifiers, - packages=['pluggy', 'pluggy.callers'], + packages=["pluggy", "pluggy.callers"], package_dir={"": "src"}, ext_modules=exts, cmdclass=cmdclass, diff --git a/src/pluggy/callers/__init__.py b/src/pluggy/callers/__init__.py index 2a3e030a..38695b27 100644 --- a/src/pluggy/callers/__init__.py +++ b/src/pluggy/callers/__init__.py @@ -6,7 +6,7 @@ from .._result import HookCallError, _Result, _raise_wrapfail from .cythonized import _c_multicall -__all__ = ['_multicall', '_c_multicall'] +__all__ = ["_multicall", "_c_multicall"] def _multicall(hook_impls, caller_kwargs, firstresult=False): diff --git a/testing/benchmark.py b/testing/benchmark.py index f98fbcca..fd048ac8 100644 --- a/testing/benchmark.py +++ b/testing/benchmark.py @@ -38,10 +38,7 @@ def wrappers(request): return [wrapper for i in range(request.param)] -@pytest.fixture( - params=[_multicall, _c_multicall], - ids=lambda item: item.__name__ -) +@pytest.fixture(params=[_multicall, _c_multicall], ids=lambda item: item.__name__) def callertype(request): return request.param