Last change
on this file since 178:37f36ea93838 was
175:28e7ea5314e4,
checked in by Ralph Meijer <ralphm@…>, 10 years ago
|
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.
|
|
File size:
1.3 KB
|
Rev | Line | |
---|
[3] | 1 | #!/usr/bin/env python |
---|
| 2 | |
---|
[96] | 3 | # Copyright (c) Ralph Meijer. |
---|
[3] | 4 | # See LICENSE for details. |
---|
| 5 | |
---|
| 6 | from setuptools import setup |
---|
| 7 | |
---|
[175] | 8 | # Make sure 'twisted' doesn't appear in top_level.txt |
---|
| 9 | |
---|
| 10 | try: |
---|
| 11 | from setuptools.command import egg_info |
---|
| 12 | egg_info.write_toplevel_names |
---|
| 13 | except (ImportError, AttributeError): |
---|
| 14 | pass |
---|
| 15 | else: |
---|
| 16 | def _top_level_package(name): |
---|
| 17 | return name.split('.', 1)[0] |
---|
| 18 | |
---|
| 19 | def _hacked_write_toplevel_names(cmd, basename, filename): |
---|
| 20 | pkgs = dict.fromkeys( |
---|
| 21 | [_top_level_package(k) |
---|
| 22 | for k in cmd.distribution.iter_distribution_names() |
---|
| 23 | if _top_level_package(k) != "twisted" |
---|
| 24 | ] |
---|
| 25 | ) |
---|
| 26 | cmd.write_file("top-level names", filename, '\n'.join(pkgs) + '\n') |
---|
| 27 | |
---|
| 28 | egg_info.write_toplevel_names = _hacked_write_toplevel_names |
---|
| 29 | |
---|
[3] | 30 | setup(name='wokkel', |
---|
[167] | 31 | version='0.7.0', |
---|
[3] | 32 | description='Twisted Jabber support library', |
---|
| 33 | author='Ralph Meijer', |
---|
| 34 | author_email='ralphm@ik.nu', |
---|
| 35 | maintainer_email='ralphm@ik.nu', |
---|
| 36 | url='http://wokkel.ik.nu/', |
---|
| 37 | license='MIT', |
---|
| 38 | platforms='any', |
---|
| 39 | packages=[ |
---|
| 40 | 'wokkel', |
---|
[19] | 41 | 'wokkel.test', |
---|
[91] | 42 | 'twisted.plugins', |
---|
[3] | 43 | ], |
---|
[91] | 44 | package_data={'twisted.plugins': ['twisted/plugins/server.py']}, |
---|
[163] | 45 | zip_safe=False, |
---|
| 46 | install_requires=[ |
---|
| 47 | 'Twisted >= 10.0.0', |
---|
| 48 | 'python-dateutil', |
---|
| 49 | ], |
---|
[3] | 50 | ) |
---|
Note: See
TracBrowser
for help on using the repository browser.