|
1 |
| -#!/usr/bin/env python |
2 |
| -# pylint: disable=missing-docstring |
3 |
| - |
4 | 1 | """Main setup script."""
|
5 | 2 |
|
6 | 3 | import ast
|
7 | 4 | from os import path
|
8 | 5 | from setuptools import setup, find_packages
|
9 | 6 |
|
10 |
| -VERSION = "1.2.3" |
| 7 | +NAME = "twitter-toolbox" |
| 8 | +VERSION = "1.2.4" |
11 | 9 | DESCRIPTION = "Twitter Toolbox for Python"
|
12 | 10 | AUTHOR = "Hugo Hromic"
|
13 | 11 | AUTHOR_EMAIL = "[email protected]"
|
14 | 12 | URL = "https://github.com/hhromic/python-twitter-toolbox"
|
| 13 | +DOWNLOAD_URL = URL + "/tarball/" + VERSION |
15 | 14 |
|
16 |
| -def read_long_description(): |
17 |
| - with open("README.rst") as reader: |
| 15 | +def _read_file(filename): |
| 16 | + with open(filename) as reader: |
18 | 17 | return reader.read()
|
19 | 18 |
|
20 |
| -def generate_console_scripts(): |
| 19 | +def _gen_console_scripts(): |
21 | 20 | with open(path.join("twtoolbox", "cli.py")) as reader:
|
22 | 21 | cli_tree = ast.parse(reader.read())
|
23 | 22 | return ["%s = twtoolbox.cli:%s" % (fn.name.replace("_", "-"), fn.name)
|
24 | 23 | for fn in cli_tree.body if isinstance(fn, ast.FunctionDef) and
|
25 | 24 | fn.name.startswith('tt_')]
|
26 | 25 |
|
27 | 26 | setup(
|
28 |
| - name="twitter-toolbox", version=VERSION, description=DESCRIPTION, |
| 27 | + name=NAME, version=VERSION, description=DESCRIPTION, |
29 | 28 | author=AUTHOR, author_email=AUTHOR_EMAIL,
|
30 | 29 | maintainer=AUTHOR, maintainer_email=AUTHOR_EMAIL,
|
31 |
| - url=URL, download_url=URL + "/tarball/" + VERSION, |
| 30 | + url=URL, download_url=DOWNLOAD_URL, |
32 | 31 | requires=["tweepy", "colorlog"],
|
33 | 32 | install_requires=["tweepy", "colorlog"],
|
34 | 33 | provides=["twtoolbox"],
|
35 | 34 | keywords=["twitter", "api", "cli", "toolbox"],
|
36 | 35 | classifiers=["Environment :: Console"],
|
37 | 36 | license="Apache-2.0",
|
38 | 37 | 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", |
41 | 40 | packages=find_packages(),
|
42 | 41 | package_data={"twtoolbox": ["defaults.cfg"]},
|
43 |
| - entry_points={"console_scripts": generate_console_scripts()}, |
| 42 | + entry_points={"console_scripts": _gen_console_scripts()}, |
44 | 43 | )
|
0 commit comments