Skip to content

Circular Dependencies when there are none #1397

@jakubclark

Description

@jakubclark

I am...

  • Reporting a bug
  • Suggesting a new feature
  • Requesting help with running my bot
  • Requesting help writing plugins
  • Here about something else

I am running...

  • Errbot version: 6.1.1
  • OS version: Tried on Windows and MacOS
  • Python version: 3.6.8
  • Using a virtual environment: N/A

Issue description

I have a situation where I have a total of 3 plugins:

  • PluginA
  • PluginB
  • PluginC

Below are their plugin dependencies:

  • PluginA depends on PluginB and PluginC
  • PluginB depends on PluginC

I've roughly visualized the dependencies here:

deps

Trying to run with this configuration results in an error:

2019-12-05 20:21:59,078 INFO     errbot.core               Error: PluginA failed to activate: Circular dependency in the set of plugins (PluginC, PluginA, PluginB).

PluginA fails to load, due to "circular dependencies". However, I do not see circular dependencies from what I described above.

So is this intentional; not allowing PluginA to depend on PluginC, since PluginB already depends on PluginC, and PluginA does depend on PluginB?

There aren't circular dependencies, since self depends on the same plugins as a child plugin depends on.

A workaround is to do something like this:

PluginA does not depend on PluginC

Then, from within PluginA do teh following:

self.get_plugin('PluginB').get_plugin('PluginC')

Steps to reproduce

I've created a repo with the necessary code to reproduce this error here.
Simply run the test: pytest plugins_test.py.
Or run errbot itself, it is configured for text mode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions