Skip to content

Commit

Permalink
Merge pull request #2 from chilispa/fixed-setup
Browse files Browse the repository at this point in the history
Fixed import of redis in setup.py
  • Loading branch information
cosimomeli authored Aug 29, 2018
2 parents c6d2218 + 49632ac commit a81d394
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 27 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: python
python:
- "3.6"
install: "pip install -r requirements.txt"
script: make clean coverage docs dist
install: "pip install ."
script: make clean test coverage docs dist
deploy:
provider: pypi
user: nottyo
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ test: ## run tests quickly with the default Python
python setup.py test

coverage: ## check code coverage quickly with the default Python
pip install coverage
coverage run --source RedisLibrary setup.py test
coverage report -m
coverage html
Expand Down
8 changes: 2 additions & 6 deletions RedisLibrary/RedisLibraryKeywords.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
# -*- coding: utf-8 -*-
from robot.api import logger
from robot.api.deco import keyword
from .version import VERSION
import redis

__author__ = 'Traitanit Huangsri'
__email__ = '[email protected]'
__version__ = VERSION


class RedisLibraryKeywords(object):

@keyword('Connect To Redis')
def connect_to_redis(self, redis_host, redis_port=6379, db=0): # pragma: no cover
def connect_to_redis(self, redis_host, redis_port=6379, db=0): # pragma: no cover
"""Connect to the Redis server.
Arguments:
Expand Down Expand Up @@ -166,7 +164,5 @@ def check_if_key_exits(self, redis_conn, key):
| ${is_exist}= | Check If Key Exists | ${redis_conn} | BARCODE|1234567890 |
"""
if redis_conn.exists(key) is False:
logger.error("Key " + key +" doesn't exist in Redis.")
logger.error("Key " + key + " doesn't exist in Redis.")
raise AssertionError


4 changes: 2 additions & 2 deletions RedisLibrary/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
import pkg_resources # part of setuptools
from .RedisLibraryKeywords import RedisLibraryKeywords
from .version import VERSION

__author__ = 'Traitanit Huangsri'
__email__ = '[email protected]'
__version__ = VERSION
__version__ = pkg_resources.require("robotframework-redislibrary")[0].version


class RedisLibrary(RedisLibraryKeywords):
Expand Down
4 changes: 0 additions & 4 deletions RedisLibrary/version.py

This file was deleted.

1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.3
5 changes: 1 addition & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
robotframework>=3.0
coverage
tox
fakeredis==0.8.2
redis==2.10.5
redis>=2.10.5
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[metadata]
description-file = README.md
description-file = README.md
24 changes: 16 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
from setuptools import setup
from RedisLibrary.version import VERSION

requirements = [
'tox',
'coverage',
'robotframework>=3.0',
'redis>=2.10.5'
]

def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()


def readlines(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).readlines()


version = read('VERSION')

requirements = readlines('requirements.txt')

test_requirements = [
'tox',
'coverage',
'fakeredis==0.8.2'
]

Expand All @@ -25,7 +33,7 @@

setup(
name='robotframework-redislibrary',
version=VERSION,
version=version,
description="robotframework-redislibrary is a Robot Framework test library for manipulating in-memory data which store in Redis",
author="Traitanit Huangsri",
author_email='[email protected]',
Expand Down

0 comments on commit a81d394

Please sign in to comment.