Skip to content

Commit 3acefa2

Browse files
committed
reverted wrong setuptools changes and enhanced setup script
1 parent f3995e8 commit 3acefa2

2 files changed

Lines changed: 31 additions & 25 deletions

File tree

setup.cfg

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,5 @@
11
[metadata]
22
description-file = README.md
3-
name = twitter-toolbox
4-
version = 1.1.0
5-
description = Twitter Toolbox for Python
6-
long_description = Twitter Toolbox for Python
7-
author = Hugo Hromic
8-
author_email = hhromic@gmail.com
9-
maintainer = Hugo Hromic
10-
maintainer_email = hhromic@gmail.com
11-
url = https://github.com/hhromic/python-twitter-toolbox
12-
download_url = https://github.com/hhromic/python-twitter-toolbox/tarball/1.1.0
13-
requires = tweepy, colorlog
14-
install_requires = tweepy, colorlog
15-
provides = twtoolbox
16-
keywords = twitter, api, cli, toolbox
17-
classifiers = Environment :: Console
18-
license = Apache-2.0
19-
platforms = all
20-
21-
[options.package_data]
22-
twtoolbox = defaults.cfg
233

244
[bdist_wheel]
255
universal = 1

setup.py

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,43 @@
11
#!/usr/bin/env python
2+
# pylint: disable=missing-docstring
23

34
"""Main setup script."""
45

56
import ast
67
from os import path
78
from setuptools import setup, find_packages
89

9-
CLI_TREE = ast.parse(open(path.join("twtoolbox", "cli.py")).read())
10-
CONSOLE_SCRIPTS = ["%s = twtoolbox.cli:%s" % (fn.name.replace("_", "-"), fn.name)
11-
for fn in CLI_TREE.body
12-
if isinstance(fn, ast.FunctionDef) and fn.name.startswith('tt_')]
10+
VERSION = "1.2.0"
11+
DESCRIPTION = "Twitter Toolbox for Python"
12+
AUTHOR = "Hugo Hromic"
13+
AUTHOR_EMAIL = "hhromic@gmail.com"
14+
URL = "https://github.com/hhromic/python-twitter-toolbox"
15+
16+
def read_long_description():
17+
with open("README.rst") as reader:
18+
return reader.read()
19+
20+
def generate_console_scripts():
21+
with open(path.join("twtoolbox", "cli.py")) as reader:
22+
cli_tree = ast.parse(reader.read())
23+
return ["%s = twtoolbox.cli:%s" % (fn.name.replace("_", "-"), fn.name)
24+
for fn in cli_tree.body if isinstance(fn, ast.FunctionDef) and
25+
fn.name.startswith('tt_')]
1326

1427
setup(
28+
name="twitter-toolbox", version=VERSION, description=DESCRIPTION,
29+
author=AUTHOR, author_email=AUTHOR_EMAIL,
30+
maintainer=AUTHOR, maintainer_email=AUTHOR_EMAIL,
31+
url=URL, download_url=URL + "/tarball/" + VERSION,
32+
requires=["tweepy", "colorlog"],
33+
install_requires=["tweepy", "colorlog"],
34+
provides=["twtoolbox"],
35+
keywords=["twitter", "api", "cli", "toolbox"],
36+
classifiers=["Environment :: Console"],
37+
license="Apache-2.0",
38+
platforms=["all"],
39+
long_description=read_long_description(),
1540
packages=find_packages(),
16-
entry_points={"console_scripts": CONSOLE_SCRIPTS},
41+
package_data={"twtoolbox": ["defaults.cfg"]},
42+
entry_points={"console_scripts": generate_console_scripts()},
1743
)

0 commit comments

Comments
 (0)