Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

monkeypatch: remove pkg_resources.fixup_namespace_packages call in syspath_prepend #13807

Copy link
Copy link

Description

@bluetech
Issue body actions

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.

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

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

Morty Proxy This is a proxified and sanitized view of the page, visit original site.