mirror of
https://github.com/cheat/cheat.git
synced 2024-11-14 08:01:09 +01:00
Use entry_points instead of scripts in setup.py
This allows a fine-grained control of the dependencies, because it generates a wrapper script that calls the specifiend function (i.e., main inside cheat/app.py)
This commit is contained in:
parent
5caa8fed38
commit
4d57f529c9
2 changed files with 12 additions and 4 deletions
|
@ -31,12 +31,13 @@ Options:
|
|||
"""
|
||||
|
||||
# require the dependencies
|
||||
from cheat import *
|
||||
from cheat.utils import *
|
||||
import sheet
|
||||
import sheets
|
||||
from utils import *
|
||||
from docopt import docopt
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
def main():
|
||||
# parse the command-line options
|
||||
options = docopt(__doc__, version='cheat 2.1.3')
|
||||
|
||||
|
@ -59,3 +60,6 @@ if __name__ == '__main__':
|
|||
# print the cheatsheet
|
||||
else:
|
||||
print(colorize(sheet.read(options['<cheatsheet>'])))
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
6
setup.py
6
setup.py
|
@ -23,7 +23,11 @@ setup(
|
|||
package_data = {
|
||||
'cheat.cheatsheets': ['*'],
|
||||
},
|
||||
scripts = ['bin/cheat'],
|
||||
entry_points = {
|
||||
'console_scripts': [
|
||||
'cheat = cheat.app:main',
|
||||
],
|
||||
},
|
||||
install_requires = [
|
||||
'docopt >= 0.6.1',
|
||||
'pygments >= 1.6.0',
|
||||
|
|
Loading…
Reference in a new issue