Merge branch 'setup-improvements' of https://github.com/youtux/cheat into youtux-setup-improvements

* 'setup-improvements' of https://github.com/youtux/cheat:
  Use entry_points instead of scripts in setup.py
  Improve setup.py description
  Exploit setuptools package_data to include cheats
  Use find_packages from setuptools to identify packages
  Use setuptools insted of distutils.
This commit is contained in:
Chris Lane 2015-10-15 18:33:02 -04:00
commit e0adbbc5b9
2 changed files with 27 additions and 16 deletions

View file

@ -31,12 +31,13 @@ Options:
""" """
# require the dependencies # require the dependencies
from cheat import * import sheet
from cheat.utils import * import sheets
from utils import *
from docopt import docopt from docopt import docopt
if __name__ == '__main__': def main():
# parse the command-line options # parse the command-line options
options = docopt(__doc__, version='cheat 2.1.16') options = docopt(__doc__, version='cheat 2.1.16')
@ -59,3 +60,6 @@ if __name__ == '__main__':
# print the cheatsheet # print the cheatsheet
else: else:
print(colorize(sheet.read(options['<cheatsheet>']))) print(colorize(sheet.read(options['<cheatsheet>'])))
if __name__ == '__main__':
main()

View file

@ -1,5 +1,14 @@
from distutils.core import setup """cheat
import os ~~~~~~~~
cheat allows you to create and view interactive cheatsheets on the
command-line. It was designed to help remind *nix system administrators of
options for commands that they use frequently, but not frequently enough
to remember.
:license: GPL3
"""
from setuptools import setup, find_packages
setup( setup(
name = 'cheat', name = 'cheat',
@ -7,20 +16,18 @@ setup(
author = 'Chris Lane', author = 'Chris Lane',
author_email = 'chris@chris-allen-lane.com', author_email = 'chris@chris-allen-lane.com',
license = 'GPL3', license = 'GPL3',
description = 'cheat allows you to create and view interactive cheatsheets ' description = 'cheat allows you to create and view interactive cheatsheets on the command-line',
'on the command-line. It was designed to help remind *nix system ' long_description = __doc__,
'administrators of options for commands that they use frequently, but not '
'frequently enough to remember.',
url = 'https://github.com/chrisallenlane/cheat', url = 'https://github.com/chrisallenlane/cheat',
packages = [ packages = find_packages(),
'cheat',
'cheat.cheatsheets',
'cheat.test',
],
package_data = { package_data = {
'cheat.cheatsheets': [f for f in os.listdir('cheat/cheatsheets') if '.' not in f] 'cheat.cheatsheets': ['*'],
},
entry_points = {
'console_scripts': [
'cheat = cheat.app:main',
],
}, },
scripts = ['bin/cheat'],
install_requires = [ install_requires = [
'docopt >= 0.6.1', 'docopt >= 0.6.1',
'pygments >= 1.6.0', 'pygments >= 1.6.0',