3

I wrote a plugin for pytest which adds command line option. Another plugin adds command line option with the same name. Thus, they shouldn't be both installed at the same time.

Is there anything I can configure with my setup.py script to prevent user from doing so?

Red
  • 1,450
  • 2
  • 17
  • 33
  • No, there is no such option. This makes sense, as there would be lots of obscure ways to break the package dependency tree. Why don't you let the user install your plugin, but check for other plugin installed in the plugin's code? You could then issue a warning, pointing the user at the option being unavailable. `if config.pluginmanager.get_plugin('otherplugin') is not None: ...` – hoefling Jul 21 '18 at 07:44

1 Answers1

0

There isn't a convenient option for setup to specify conflicts (more importantly, it looks like setuptools are not capable to detect conflicts reliably), but you can use access to installed packages (the solution based on pkg_resources) described in this answer to write your own code in setup.py script which would detect and handle conflicts. This is not perfect, but can be a workaround.

scrutari
  • 1,378
  • 2
  • 17
  • 33