-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Copy link
Labels
plugin: monkeypatchrelated to the monkeypatch builtin pluginrelated to the monkeypatch builtin plugintype: backward compatibilitymight present some backward compatibility issues which should be carefully noted in the changelogmight present some backward compatibility issues which should be carefully noted in the changelogtype: deprecationfeature that will be removed in the futurefeature that will be removed in the futuretype: proposalproposal for a new feature, often to gather opinions or design the API around the new featureproposal for a new feature, often to gather opinions or design the API around the new feature
Description
monkeypatch.syspath_prepend calls it:
pytest/src/_pytest/monkeypatch.py
Lines 340 to 351 in 9d74e03
| 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
plugin: monkeypatchrelated to the monkeypatch builtin pluginrelated to the monkeypatch builtin plugintype: backward compatibilitymight present some backward compatibility issues which should be carefully noted in the changelogmight present some backward compatibility issues which should be carefully noted in the changelogtype: deprecationfeature that will be removed in the futurefeature that will be removed in the futuretype: proposalproposal for a new feature, often to gather opinions or design the API around the new featureproposal for a new feature, often to gather opinions or design the API around the new feature