Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Distributing Twisted plugins with distutils
Example of a way to distribute Twisted plugins with distutils. This would go in your file.
data_files would get passed to setup() through the data_files keyword.
from distutils.sysconfig import get_python_lib
TWISTED_PLUGIN_PATH = os.path.join(get_python_lib(), 'twisted', 'plugins')
MODULE_PLUGIN_PATH = os.path.join('your_module', 'twisted', 'plugins')
data_files = [
[os.path.join(MODULE_PLUGIN_PATH, '')]
# Your call to distribute.setup() here
# This is needed to re-generate the Twisted plugin dropin.cache after install.
from twisted.plugin import getPlugins
except ImportError:
# Probably haven't installed yet. Fail silently.

This comment has been minimized.

Copy link

commented Jun 9, 2012

pip won't uninstall the .pyc/.pyo this way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.