Skip to content

Commit db0f924

Browse files
committed
Update setup.py
switch scripts to console-script
1 parent b04b5d3 commit db0f924

File tree

3 files changed

+12
-20
lines changed

3 files changed

+12
-20
lines changed

setup.py

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env python
12
# -*- coding: utf-8 -*-
23
#
34
# Copyright (C) 2016 Andi Albrecht, [email protected]
@@ -6,16 +7,8 @@
67
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
78

89
import re
9-
import sys
1010

11-
try:
12-
from setuptools import setup, find_packages
13-
packages = find_packages(exclude=('tests',))
14-
except ImportError:
15-
if sys.version_info[0] == 3:
16-
raise RuntimeError('distribute is required to install this package.')
17-
from distutils.core import setup
18-
packages = ['sqlparse', 'sqlparse.engine']
11+
from setuptools import setup, find_packages
1912

2013

2114
def get_version():
@@ -81,19 +74,15 @@ def get_version():
8174
8275
"""
8376

84-
VERSION = get_version()
85-
86-
8777
setup(
8878
name='sqlparse',
89-
version=VERSION,
90-
packages=packages,
91-
description='Non-validating SQL parser',
79+
version=get_version(),
9280
author='Andi Albrecht',
9381
author_email='[email protected]',
82+
url='https://github.com/andialbrecht/sqlparse',
83+
description='Non-validating SQL parser',
9484
long_description=LONG_DESCRIPTION,
9585
license='BSD',
96-
url='https://github.com/andialbrecht/sqlparse',
9786
classifiers=[
9887
'Development Status :: 4 - Beta',
9988
'Intended Audience :: Developers',
@@ -107,7 +96,12 @@ def get_version():
10796
'Programming Language :: Python :: 3.4',
10897
'Programming Language :: Python :: 3.5',
10998
'Topic :: Database',
110-
'Topic :: Software Development'
99+
'Topic :: Software Development',
111100
],
112-
scripts=['bin/sqlformat'],
101+
packages=find_packages(exclude=('tests',)),
102+
entry_points={
103+
'console_scripts': [
104+
'sqlparse = sqlparse.__main__:main',
105+
]
106+
},
113107
)
File renamed without changes.

tox.ini

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ deps =
1717
passenv =
1818
TRAVIS
1919
commands =
20-
python --version
21-
sqlformat --version
2220
py.test --cov=sqlparse
2321

2422
[testenv:flake8]

0 commit comments

Comments
 (0)