Skip to content

Commit de35932

Browse files
committed
improve setup.py
1 parent 77f8b38 commit de35932

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

setup.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,43 @@
1-
#!/usr/bin/env python
2-
# pylint: disable=missing-docstring
3-
41
"""Main setup script."""
52

63
import ast
74
from os import path
85
from setuptools import setup, find_packages
96

10-
VERSION = "1.2.3"
7+
NAME = "twitter-toolbox"
8+
VERSION = "1.2.4"
119
DESCRIPTION = "Twitter Toolbox for Python"
1210
AUTHOR = "Hugo Hromic"
1311
AUTHOR_EMAIL = "[email protected]"
1412
URL = "https://github.com/hhromic/python-twitter-toolbox"
13+
DOWNLOAD_URL = URL + "/tarball/" + VERSION
1514

16-
def read_long_description():
17-
with open("README.rst") as reader:
15+
def _read_file(filename):
16+
with open(filename) as reader:
1817
return reader.read()
1918

20-
def generate_console_scripts():
19+
def _gen_console_scripts():
2120
with open(path.join("twtoolbox", "cli.py")) as reader:
2221
cli_tree = ast.parse(reader.read())
2322
return ["%s = twtoolbox.cli:%s" % (fn.name.replace("_", "-"), fn.name)
2423
for fn in cli_tree.body if isinstance(fn, ast.FunctionDef) and
2524
fn.name.startswith('tt_')]
2625

2726
setup(
28-
name="twitter-toolbox", version=VERSION, description=DESCRIPTION,
27+
name=NAME, version=VERSION, description=DESCRIPTION,
2928
author=AUTHOR, author_email=AUTHOR_EMAIL,
3029
maintainer=AUTHOR, maintainer_email=AUTHOR_EMAIL,
31-
url=URL, download_url=URL + "/tarball/" + VERSION,
30+
url=URL, download_url=DOWNLOAD_URL,
3231
requires=["tweepy", "colorlog"],
3332
install_requires=["tweepy", "colorlog"],
3433
provides=["twtoolbox"],
3534
keywords=["twitter", "api", "cli", "toolbox"],
3635
classifiers=["Environment :: Console"],
3736
license="Apache-2.0",
3837
platforms=["all"],
39-
long_description=read_long_description(),
40-
long_description_content_type="text/x-rst",
38+
long_description=_read_file("README.md"),
39+
long_description_content_type="text/markdown",
4140
packages=find_packages(),
4241
package_data={"twtoolbox": ["defaults.cfg"]},
43-
entry_points={"console_scripts": generate_console_scripts()},
42+
entry_points={"console_scripts": _gen_console_scripts()},
4443
)

0 commit comments

Comments
 (0)