Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Added travis and tox for testing #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.coverage
.DS_Store
redlock_py.egg-info
redlock_py.egg-info/
dist
__pycache__
.cache
.cache/
.idea/
.tox/
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
language: python

python:
- 3.5

install:
- pip install tox

services:
- redis-server

script:
- tox
7 changes: 5 additions & 2 deletions redlock/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ def main():
2 if there was an error with the options
3 if there was an error communicating with Redis (eg. socket timeout)
"""))
parser.add_argument("--redis", action="append", default=None, help="Redis URL (eg. redis://localhost:6379/0", metavar="URL")
parser.add_argument("--quiet", action="store_true", default=False, help="No stderr output, just a return code (and key for lock action)")
parser.add_argument("--redis", action="append", default=None,
help="Redis URL (eg. redis://localhost:6379/0", metavar="URL")
parser.add_argument("--quiet", action="store_true", default=False,
help="No stderr output, just a return code (and key for lock action)")

subparsers = parser.add_subparsers(help='See command help via `%(prog)s <command> --help`')
parser_lock = subparsers.add_parser('lock', help='Acquire a lock', description="""
Expand Down Expand Up @@ -94,5 +96,6 @@ def main():

sys.exit(result)


if __name__ == "__main__":
main()
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,11 @@
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4'
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5'
],
author='[email protected]',
author_email='[email protected]',
Expand Down
19 changes: 19 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[tox]
envlist = py27, py33, py34, py35, flake8

[flake8]
max-line-length = 120

[testenv]
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
deps =
redis
pytest-cov
coveralls
commands =
py.test --cov {envsitepackagesdir}/redlock tests
coveralls

[testenv:flake8]
deps = flake8
commands = flake8