Fix build problems.

Fix build problems. Remove python 2.6 support. Add declare_namespace
method to module init files. Add API doc template.
This commit is contained in:
Brian Korty 2015-05-11 13:25:04 -04:00
parent b391aab881
commit e0031bfb32
7 changed files with 14 additions and 19 deletions

View file

@ -2,7 +2,6 @@ language: python
python:
- 2.7
- pypy
- 3.2
- 3.3
- 3.4
install:

2
docs/api.rst Normal file
View file

@ -0,0 +1,2 @@
.. automodule:: sprockets.clients.cassandra
:members:

View file

@ -1,8 +1,7 @@
import codecs
import sys
from setuptools
import setuptools
def read_requirements_file(req_name):
requirements = []
@ -25,7 +24,7 @@ tests_require = read_requirements_file('test-requirements.txt')
setuptools.setup(
name='sprockets.clients.cassandra',
version=sprockets.clients.cassandra.__version__,
version='0.0.0',
description='Base functionality for accessing/modifying data in Cassandra',
long_description=codecs.open('README.rst', encoding='utf-8').read(),
url='https://github.com/sprockets/sprockets.clients.cassandra.git',

View file

@ -1,3 +1 @@
# -*- coding: utf-8 -*-
version_info = (0, 0, 0)
__version__ = '.'.join(str(v) for v in version_info[:3])
__import__('pkg_resources').declare_namespace(__name__)

View file

@ -0,0 +1 @@
__import__('pkg_resources').declare_namespace(__name__)

View file

@ -19,13 +19,13 @@ class TestCassandraConnectionClass(AsyncTestCase):
super(TestCassandraConnectionClass, self).setUp()
self.cluster = Cluster(self.find_cassandra())
self.session = self.cluster.connect()
self.keyspace = 'sprocketstest{}'.format(int(time.time()*10000))
self.keyspace = 'sprocketstest{0}'.format(int(time.time()*10000))
self.create_fixtures()
self.connection = CassandraConnection(ioloop=self.io_loop)
def tearDown(self):
super(TestCassandraConnectionClass, self).tearDown()
self.session.execute("DROP KEYSPACE {}".format(self.keyspace))
self.session.execute("DROP KEYSPACE {0}".format(self.keyspace))
self.connection.shutdown()
def find_cassandra(self):
@ -36,10 +36,10 @@ class TestCassandraConnectionClass(AsyncTestCase):
def create_fixtures(self):
self.session.execute(
"CREATE KEYSPACE IF NOT EXISTS {} WITH REPLICATION = "
"CREATE KEYSPACE IF NOT EXISTS {0} WITH REPLICATION = "
"{{'class': 'SimpleStrategy', "
"'replication_factor': 1}}".format(self.keyspace))
self.session.execute("USE {}".format(self.keyspace))
self.session.execute("USE {0}".format(self.keyspace))
self.session.execute(
"CREATE TABLE IF NOT EXISTS names (name text PRIMARY KEY)")
self.session.execute(
@ -51,7 +51,7 @@ class TestCassandraConnectionClass(AsyncTestCase):
count = 100
for i in range(count):
futures.append(self.connection.execute(
"SELECT name FROM {}.names".format(self.keyspace)))
"SELECT name FROM {0}.names".format(self.keyspace)))
results = 0
for future in futures:
yield future

10
tox.ini
View file

@ -1,16 +1,12 @@
[tox]
envlist = py26,py27,py32,py33,py34
envlist = py27,py33,py34
[testenv]
commands = nosetests []
deps = -rtest-requirements.txt
deps = -rrequirements.txt
-rtest-requirements.txt
[testenv:py27]
deps =
mock>=1.0.1,<2.0
{[testenv]deps}
[testenv:py26]
deps =
unittest2==0.5.1
{[testenv:py27]deps}