Skip to content

Feature Request: Ability to remove entries in working_set / deactivate distribution #1759

@nixjdm

Description

@nixjdm

There are times when one might want to call a function to remove an item from the pkg_resources working_set, or deactivate a distribution. Notably, this may be useful in a script that manages installations of packages, such as python applications that can install and uninstall plugins.

There is already add() and add_entry(), but no remove() or remove_entry(). Similarly, there is an activate(), but no deactivate().

Searching the Internet, the closest two things I've found on this topic are a guess on StackOverflow about how to achieve this and a docs snippet that specifically warns against doing part of that guess, under https://setuptools.readthedocs.io/en/latest/pkg_resources.html#workingset-methods-and-attributes -> entries.

I haven't found anything in setuptools that does this, but I'm not intimately familiar with it either. If someone has good starting advice on how to achieve this, I'd be happy to take a stab at it myself. I would probably use the feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions