From b831bc82dc7de8ba634db4d14879961ad0940fab Mon Sep 17 00:00:00 2001 From: kakwa Date: Fri, 10 Jul 2015 21:00:19 +0200 Subject: [PATCH] apply pep8 recommandation to setup.py --- setup.py | 90 ++++++++++++++++++++++++++++++++------------------------ 1 file changed, 51 insertions(+), 39 deletions(-) diff --git a/setup.py b/setup.py index 5bb3b22..ceaa7f0 100755 --- a/setup.py +++ b/setup.py @@ -7,11 +7,11 @@ import re import sys from distutils.core import setup -#some install path variables +# some install path variables sysconfdir = os.getenv("SYSCONFDIR", "/etc") datarootdir = os.getenv("DATAROOTDIR", sys.prefix) -data_dir = os.path.join(sys.prefix, 'share' ,'ldapcherry') +data_dir = os.path.join(sys.prefix, 'share', 'ldapcherry') small_description = 'A simple web application to manage Ldap entries' # change requirements according to python version @@ -52,16 +52,15 @@ try: self.test_suite = True def run_tests(self): - #import here, cause outside the eggs aren't loaded + # import here, cause outside the eggs aren't loaded import pytest errno = pytest.main(self.test_args) sys.exit(errno) - except ImportError: - from distutils.core import setup PyTest = lambda x: x + # just a small function to easily install a complete directory def get_list_files(basedir, targetdir): return_list = [] @@ -74,42 +73,55 @@ def get_list_files(basedir, targetdir): return return_list # add static files and templates in the list of thing to deploy -resources_files = get_list_files('resources', - os.path.join(datarootdir, 'share', 'ldapcherry')) +resources_files = get_list_files( + 'resources', + os.path.join(datarootdir, 'share', 'ldapcherry') + ) # add the configuration files if they don't exist -if not os.path.exists(os.path.join(sysconfdir, 'ldapcherry')): - resources_files.append(( - os.path.join(sysconfdir, 'ldapcherry'), - [ 'conf/ldapcherry.ini', 'conf/attributes.yml', 'conf/roles.yml'] - )) +if not os.path.exists( + os.path.join(sysconfdir, 'ldapcherry')): + resources_files.append( + ( + os.path.join(sysconfdir, 'ldapcherry'), + [ + 'conf/ldapcherry.ini', + 'conf/attributes.yml', + 'conf/roles.yml' + ] + ) + ) setup( - name = 'ldapcherry', - zip_safe = False, - version = '0.0.1', - author = 'Pierre-Francois Carpentier', - author_email = 'carpentier.pf@gmail.com', - packages = ['ldapcherry', 'ldapcherry.backend', 'ldapcherry.ppolicy'], - data_files = resources_files, - scripts = ['scripts/ldapcherryd'], - url = 'https://github.com/kakwa/ldapcherry', - license = license, - description = small_description, - long_description = description, - install_requires = install_requires, - tests_require = ['pytest'], - cmdclass = {'test': PyTest}, - classifiers = [ - 'Development Status :: 3 - Alpha', - 'Environment :: Web Environment', - 'Framework :: CherryPy', - 'Intended Audience :: System Administrators', - 'License :: OSI Approved :: MIT License', - 'Natural Language :: English', - 'Operating System :: POSIX', - 'Programming Language :: Python', - 'Programming Language :: Python :: 2.7', - 'Topic :: Internet :: LDAP' - ] + name='ldapcherry', + zip_safe=False, + version='0.0.1', + author='Pierre-Francois Carpentier', + author_email='carpentier.pf@gmail.com', + packages=[ + 'ldapcherry', + 'ldapcherry.backend', + 'ldapcherry.ppolicy' + ], + data_files=resources_files, + scripts=['scripts/ldapcherryd'], + url='https://github.com/kakwa/ldapcherry', + license=license, + description=small_description, + long_description=description, + install_requires=install_requires, + tests_require=['pytest', 'pep8'], + cmdclass={'test': PyTest}, + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Environment :: Web Environment', + 'Framework :: CherryPy', + 'Intended Audience :: System Administrators', + 'License :: OSI Approved :: MIT License', + 'Natural Language :: English', + 'Operating System :: POSIX', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2.7', + 'Topic :: Internet :: LDAP' + ], )