Skip to content

Commit

Permalink
improve setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
hhromic committed Dec 12, 2018
1 parent 77f8b38 commit de35932
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions setup.py
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()},
)

0 comments on commit de35932

Please sign in to comment.