diff --git a/.travis.yml b/.travis.yml index fd0f42a..2881fe1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,12 +8,9 @@ language: python before_install: - '[ "$TEST_PEP8" == "1" ] || sudo ./tests/test_env/deploy.sh' -python: - - "2.7" - install: - pip install -e . - - "if [[ $TEST_PEP8 == '1' ]]; then pip install pep8; fi" + - "if [[ $TEST_PEP8 == '1' ]]; then pip install pycodestyle; fi" - pip install passlib - pip install coveralls @@ -21,11 +18,23 @@ install: # #script: # - coverage run --source=ldapcherry setup.py test -script: "if [[ $TEST_PEP8 == '1' ]]; then pep8 --repeat --show-source --exclude=.venv,.tox,dist,docs,build,*.egg,tests,misc,setup.py . scripts/ldapcherryd; else coverage run --source=ldapcherry setup.py test; fi" +script: "if [[ $TEST_PEP8 == '1' ]]; then pycodestyle --repeat --show-source --exclude=.venv,.tox,dist,docs,build,*.egg,tests,misc,setup.py . scripts/ldapcherryd; else coverage run --source=ldapcherry setup.py test; fi" matrix: include: - python: "2.7" env: TEST_PEP8=1 + - python: "2.7" + env: TEST_PEP8=0 + - python: "3.5" + env: TEST_PEP8=0 + - python: "3.6" + env: TEST_PEP8=0 + - python: "3.4" + env: TEST_PEP8=0 + - python: "3.7" + env: TEST_PEP8=0 + + after_success: - coveralls after_failure: diff --git a/scripts/ldapcherryd b/ldapcherry/cli.py similarity index 99% rename from scripts/ldapcherryd rename to ldapcherry/cli.py index 1547caf..0b11a05 100755 --- a/scripts/ldapcherryd +++ b/ldapcherry/cli.py @@ -102,7 +102,7 @@ def start(configfile=None, daemonize=False, environment=None, engine.block() -if __name__ == '__main__': +def main(): from optparse import OptionParser p = OptionParser() @@ -142,3 +142,6 @@ if __name__ == '__main__': start(options.config, options.daemonize, options.environment, options.fastcgi, options.scgi, options.pidfile, options.cgi, options.debug) + +if __name__ == '__main__': + main() diff --git a/setup.py b/setup.py index d47a27f..ace0cdc 100755 --- a/setup.py +++ b/setup.py @@ -29,8 +29,12 @@ if sys.version_info[0] == 2: 'Mako' ], elif sys.version_info[0] == 3: - print('unsupported version') - exit(1) + install_requires = [ + 'CherryPy >= 3.0.0', + 'python-ldap', + 'PyYAML', + 'Mako' + ], else: print('unsupported version') exit(1) @@ -120,7 +124,9 @@ setup( 'ldapcherry.ppolicy' ], data_files=resources_files, - scripts=['scripts/ldapcherryd'], + entry_points = { + 'console_scripts': ['ldapcherryd = ldapcherry.cli:main'] + }, url='https://github.com/kakwa/ldapcherry', license=license, description=small_description,