-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
11 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,43 @@ | ||
#!/usr/bin/env python | ||
# pylint: disable=missing-docstring | ||
|
||
"""Main setup script.""" | ||
|
||
import ast | ||
from os import path | ||
from setuptools import setup, find_packages | ||
|
||
VERSION = "1.2.3" | ||
NAME = "twitter-toolbox" | ||
VERSION = "1.2.4" | ||
DESCRIPTION = "Twitter Toolbox for Python" | ||
AUTHOR = "Hugo Hromic" | ||
AUTHOR_EMAIL = "[email protected]" | ||
URL = "https://github.com/hhromic/python-twitter-toolbox" | ||
DOWNLOAD_URL = URL + "/tarball/" + VERSION | ||
|
||
def read_long_description(): | ||
with open("README.rst") as reader: | ||
def _read_file(filename): | ||
with open(filename) as reader: | ||
return reader.read() | ||
|
||
def generate_console_scripts(): | ||
def _gen_console_scripts(): | ||
with open(path.join("twtoolbox", "cli.py")) as reader: | ||
cli_tree = ast.parse(reader.read()) | ||
return ["%s = twtoolbox.cli:%s" % (fn.name.replace("_", "-"), fn.name) | ||
for fn in cli_tree.body if isinstance(fn, ast.FunctionDef) and | ||
fn.name.startswith('tt_')] | ||
|
||
setup( | ||
name="twitter-toolbox", version=VERSION, description=DESCRIPTION, | ||
name=NAME, version=VERSION, description=DESCRIPTION, | ||
author=AUTHOR, author_email=AUTHOR_EMAIL, | ||
maintainer=AUTHOR, maintainer_email=AUTHOR_EMAIL, | ||
url=URL, download_url=URL + "/tarball/" + VERSION, | ||
url=URL, download_url=DOWNLOAD_URL, | ||
requires=["tweepy", "colorlog"], | ||
install_requires=["tweepy", "colorlog"], | ||
provides=["twtoolbox"], | ||
keywords=["twitter", "api", "cli", "toolbox"], | ||
classifiers=["Environment :: Console"], | ||
license="Apache-2.0", | ||
platforms=["all"], | ||
long_description=read_long_description(), | ||
long_description_content_type="text/x-rst", | ||
long_description=_read_file("README.md"), | ||
long_description_content_type="text/markdown", | ||
packages=find_packages(), | ||
package_data={"twtoolbox": ["defaults.cfg"]}, | ||
entry_points={"console_scripts": generate_console_scripts()}, | ||
entry_points={"console_scripts": _gen_console_scripts()}, | ||
) |