#!/usr/bin/env python

# Copyright (c) Ralph Meijer.
# See LICENSE for details.

from setuptools import setup

setup(name='wokkel',
      version='0.7.0',
      description='Twisted Jabber support library',
      author='Ralph Meijer',
      author_email='ralphm@ik.nu',
      maintainer_email='ralphm@ik.nu',
      url='http://wokkel.ik.nu/',
      license='MIT',
      platforms='any',
      packages=[
          'wokkel',
          'wokkel.test',
          'twisted.plugins',
      ],
      package_data={'twisted.plugins': ['twisted/plugins/server.py']},
      zip_safe=False,
      install_requires=[
          'Twisted >= 10.0.0',
          'python-dateutil',
      ],
)

#!/usr/bin/env python

# Copyright (c) Ralph Meijer.
# See LICENSE for details.

from setuptools import setup

# Make sure 'twisted' doesn't appear in top_level.txt

try:
    from setuptools.command import egg_info
    egg_info.write_toplevel_names
except (ImportError, AttributeError):
    pass
else:
    def _top_level_package(name):
        return name.split('.', 1)[0]

    def _hacked_write_toplevel_names(cmd, basename, filename):
        pkgs = dict.fromkeys(
            [_top_level_package(k)
                for k in cmd.distribution.iter_distribution_names()
                if _top_level_package(k) != "twisted"
            ]
        )
        cmd.write_file("top-level names", filename, '\n'.join(pkgs) + '\n')

    egg_info.write_toplevel_names = _hacked_write_toplevel_names

setup(name='wokkel',
      version='0.7.0',
      description='Twisted Jabber support library',
      author='Ralph Meijer',
      author_email='ralphm@ik.nu',
      maintainer_email='ralphm@ik.nu',
      url='http://wokkel.ik.nu/',
      license='MIT',
      platforms='any',
      packages=[
          'wokkel',
          'wokkel.test',
          'twisted.plugins',
      ],
      package_data={'twisted.plugins': ['twisted/plugins/server.py']},
      zip_safe=False,
      install_requires=[
          'Twisted >= 10.0.0',
          'python-dateutil',
      ],
)

Make sure 'twisted' doesn't appear in the egg-info top_level.txt file.
Make sure 'twisted' doesn't appear in the egg-info top_level.txt file.

Wokkel provides a plugin for twistd. As with all twisted plugins, these
need to be placed in a directory twisted/plugins so that the plugin mechanism
can find them. This is not a real package, and when building eggs the
directory must appear in the egg. However, 'twisted' should not occur in the
top_level.txt file as this causes warnings when importing twisted, and
triggers a bug in pip that removes all of twisted when a package with a
twisted plugin is removed.

This change overrides the way the top_level.txt file is written, by explicitly
excluding 'twisted'.

Author: ralphm.
Fixes: #76.
