1- from setuptools import setup
2- from setuptools import find_packages
3- from setuptools .command .test import test as TestCommand # noqa
41import os
52import re
63import sys
74
5+ from setuptools import find_packages
6+ from setuptools import setup
7+ from setuptools .command .test import test as TestCommand # noqa
8+
89
910with open (
1011 os .path .join (
11- os .path .dirname (__file__ ), 'sqlalchemy_collectd' , '__init__.py' )
12+ os .path .dirname (__file__ ), "sqlalchemy_collectd" , "__init__.py"
13+ )
1214) as file_ :
13- VERSION = re .compile (
14- r".*__version__ = '(.*?)'" , re .S ).match (file_ .read ()).group (1 )
15+ VERSION = (
16+ re .compile (r".*__version__ = [\"'](.*?)[\"']" , re .S )
17+ .match (file_ .read ())
18+ .group (1 )
19+ )
1520
1621
17- readme = os .path .join (os .path .dirname (__file__ ), ' README.rst' )
22+ readme = os .path .join (os .path .dirname (__file__ ), " README.rst" )
1823
19- requires = [
20- 'SQLAlchemy>=1.1' ,
21- ]
24+ requires = ["SQLAlchemy>=1.1" ]
2225
2326
2427class PyTest (TestCommand ):
25- user_options = [(' pytest-args=' , 'a' , "Arguments to pass to py.test" )]
28+ user_options = [(" pytest-args=" , "a" , "Arguments to pass to py.test" )]
2629
2730 def initialize_options (self ):
2831 TestCommand .initialize_options (self )
@@ -36,36 +39,37 @@ def finalize_options(self):
3639 def run_tests (self ):
3740 # import here, cause outside the eggs aren't loaded
3841 import pytest
42+
3943 errno = pytest .main (self .pytest_args )
4044 sys .exit (errno )
4145
4246
4347setup (
44- name = ' sqlalchemy-collectd' ,
48+ name = " sqlalchemy-collectd" ,
4549 version = VERSION ,
4650 description = "Send database connection pool stats to collectd" ,
4751 long_description = open (readme ).read (),
4852 classifiers = [
49- ' Development Status :: 3 - Alpha' ,
50- ' Intended Audience :: Developers' ,
51- ' Programming Language :: Python' ,
52- ' Programming Language :: Python :: 3' ,
53- ' Topic :: Database :: Front-Ends' ,
53+ " Development Status :: 3 - Alpha" ,
54+ " Intended Audience :: Developers" ,
55+ " Programming Language :: Python" ,
56+ " Programming Language :: Python :: 3" ,
57+ " Topic :: Database :: Front-Ends" ,
5458 ],
55- keywords = ' SQLAlchemy collectd' ,
56- author = ' Mike Bayer' ,
57- author_email = ' mike@zzzcomputing.com' ,
58- url = ' https://github.com/sqlalchemy/sqlalchemy-collectd' ,
59- license = ' MIT' ,
59+ keywords = " SQLAlchemy collectd" ,
60+ author = " Mike Bayer" ,
61+ author_email = " mike@zzzcomputing.com" ,
62+ url = " https://github.com/sqlalchemy/sqlalchemy-collectd" ,
63+ license = " MIT" ,
6064 packages = find_packages ("." , exclude = ["examples*" , "*.tests" ]),
6165 include_package_data = True ,
62- tests_require = [' pytest' , ' mock' ],
63- cmdclass = {' test' : PyTest },
66+ tests_require = [" pytest" , " mock" ],
67+ cmdclass = {" test" : PyTest },
6468 zip_safe = False ,
6569 install_requires = requires ,
6670 entry_points = {
67- ' sqlalchemy.plugins' : [
68- ' collectd = sqlalchemy_collectd.client.plugin:Plugin'
71+ " sqlalchemy.plugins" : [
72+ " collectd = sqlalchemy_collectd.client.plugin:Plugin"
6973 ]
70- }
74+ },
7175)
0 commit comments