How do I write a setup.py for a twistd/twisted plugin that works with setuptools, distribute, etc?

前端 未结 4 1452
礼貌的吻别
礼貌的吻别 2020-12-23 12:21

The Twisted Plugin System is the preferred way to write extensible twisted applications.

However, due to the way the plugin system is structured (plugins go into a

4条回答
  •  囚心锁ツ
    2020-12-23 12:39

    Maybe you could adapt the package_data idea to use data_files instead: it wouldn’t require you to list twisted.plugins as package, as it uses absolute paths. It would still be a kludge, though.

    My tests with pure distutils have told me that its is possible to overwrite files from another distribution. I wanted to test poor man’s namespace packages using pkgutil.extend_path and distutils, and it turns out that I can install spam/ham/__init__.py with spam.ham/setup.py and spam/eggs/__init__.py with spam.eggs/setup.py. Directories are not a problem, but files will be happily overwritten. I think this is actually undefined behavior in distutils which trickles up to setuptools and pip, so pip could IMO close as wontfix.

    What is the usual way to install Twisted plugins? Drop-it-here by hand?

提交回复
热议问题