monkeypatch.syspath_prepend calls it:
|
def syspath_prepend(self, path) -> None: |
|
"""Prepend ``path`` to ``sys.path`` list of import locations.""" |
|
if self._savesyspath is None: |
|
self._savesyspath = sys.path[:] |
|
sys.path.insert(0, str(path)) |
|
|
|
# https://github.com/pypa/setuptools/blob/d8b901bc/docs/pkg_resources.txt#L162-L171 |
|
# this is only needed when pkg_resources was already loaded by the namespace package |
|
if "pkg_resources" in sys.modules: |
|
from pkg_resources import fixup_namespace_packages |
|
|
|
fixup_namespace_packages(str(path)) |
This is needed for legacy namespace package support, which is now deprecated, along with the entire pkg_resources package.
I saw recently that zope packages which were the last holdouts I was familiar with had switched to new namespace package style, zope.event, zope.interface.
Let's start removing it. The main reason is that it requires us to have a setuptools dev dependency, ignore its deprecation warnings and keep it working.
Let's deprecate it and remove in pytest 10.
monkeypatch.syspath_prependcalls it:pytest/src/_pytest/monkeypatch.py
Lines 340 to 351 in 9d74e03
This is needed for legacy namespace package support, which is now deprecated, along with the entire
pkg_resourcespackage.I saw recently that
zopepackages which were the last holdouts I was familiar with had switched to new namespace package style, zope.event, zope.interface.Let's start removing it. The main reason is that it requires us to have a setuptools dev dependency, ignore its deprecation warnings and keep it working.
Let's deprecate it and remove in pytest 10.