pytest-dev / pluggy

A minimalist production ready plugin system
https://pluggy.readthedocs.io/en/latest/
MIT License
1.24k stars 121 forks source link

Defer loading of importtlib.metadata #466

Closed bluetech closed 8 months ago

bluetech commented 8 months ago

Refs https://github.com/pytest-dev/pluggy/pull/445#issuecomment-1732573535

This package is needed for load_setuptools_entrypoints, but it is quite slow to import. While most users do use load_setuptools_entrypoints, maybe some don't, so let's let them avoid the cost.

For import pluggy: Before: 36ms After: 11ms

ofek commented 8 months ago

Is the failure related to the current change?

RonnyPfannschmidt commented 8 months ago

we should apply https://hynek.me/articles/ditch-codecov-python/ by grace of @hynek to be free

bluetech commented 8 months ago

We do have if TYPE_CHECKING: in the coverage exclude lines so not I'm sure why it doesn't skip it. Local coverage does skip it.