Distribution: Create script with setup.py

This commit is contained in:
Adrien Vergé 2016-01-24 18:02:42 +01:00
parent 5ed496f471
commit be998593dd
3 changed files with 2 additions and 26 deletions

View File

@ -1,24 +0,0 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2016 Adrien Vergé
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys
from yamllint import cli
if __name__ == '__main__':
cli.run(sys.argv[1:])

View File

@ -42,7 +42,7 @@ setup(
],
packages=find_packages(),
scripts=['bin/yamllint'],
entry_points={'console_scripts': ['yamllint=yamllint.cli:run']},
package_data={'yamllint': ['conf/*.yml']},
install_requires=['pyyaml'],
tests_require=['nose'],

View File

@ -62,7 +62,7 @@ class Format(object):
return line
def run(argv):
def run(argv=None):
parser = argparse.ArgumentParser(prog=APP_NAME,
description=APP_DESCRIPTION)
parser.add_argument('files', metavar='FILE_OR_DIR', nargs='+',