|
2 | 2 |
|
3 | 3 | """Main setup script.""" |
4 | 4 |
|
| 5 | +import ast |
5 | 6 | from setuptools import setup, find_packages |
6 | | -import twtoolbox.cli |
7 | 7 |
|
8 | | -CONSOLE_SCRIPTS = ["%s = twtoolbox.cli:%s" % (fn.replace("_", "-"), fn) |
9 | | - for fn in dir(twtoolbox.cli) if fn.startswith("tt_")] |
| 8 | +CLI_TREE = ast.parse(open('twtoolbox/cli.py').read()) |
| 9 | +CONSOLE_SCRIPTS = ["%s = twtoolbox.cli:%s" % (fn.name.replace("_", "-"), fn.name) |
| 10 | + for fn in CLI_TREE.body |
| 11 | + if isinstance(fn, ast.FunctionDef) and fn.name.startswith('tt_')] |
10 | 12 |
|
11 | 13 | setup( |
12 | | - name="twitter-toolbox", |
13 | 14 | packages=find_packages(), |
14 | | - package_data={"twtoolbox": ["defaults.cfg"]}, |
15 | | - version="1.0.3", |
16 | | - description="Twitter Toolbox for Python", |
17 | | - long_description="Twitter Toolbox for Python", |
18 | | - author="Hugo Hromic", |
19 | | - author_email="hhromic@gmail.com", |
20 | | - url="https://github.com/hhromic/python-twitter-toolbox", |
21 | | - download_url="https://github.com/hhromic/python-twitter-toolbox/tarball/1.0.3", |
22 | | - install_requires=["tweepy", "colorlog"], |
23 | | - keywords=["twitter", "api", "cli", "toolbox"], |
24 | | - classifiers=["Environment :: Console"], |
25 | | - license="Apache-2.0", |
26 | | - platforms=["all"], |
27 | 15 | entry_points={"console_scripts": CONSOLE_SCRIPTS}, |
28 | 16 | ) |
0 commit comments