Skip to content

Commit

Permalink
Add Python 3 support (#10)
Browse files Browse the repository at this point in the history
* Test against 2.6 3.3 and 3.4

* Add Cassadra Driver Version 3.1.0

https://github.com/datastax/python-driver/releases/tag/3.1.0

* Add python3 details to setup.py and README

* Fix issues with README

* Add driver versions 3.1.1, 3.2.0 and 3.2.1
  • Loading branch information
thegeorgeous committed Apr 17, 2016
1 parent 68716ce commit a70f5ac
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@ services:
language: python

python:
- 2.6
- 2.7

- 3.3
- 3.4
env:
- CASSANDRA_DRIVER_VERSION=2.6.0
- CASSANDRA_DRIVER_VERSION=2.7.2
- CASSANDRA_DRIVER_VERSION=3.0.0
- CASSANDRA_DRIVER_VERSION=3.1.0
- CASSANDRA_DRIVER_VERSION=3.1.1
- CASSANDRA_DRIVER_VERSION=3.2.0
- CASSANDRA_DRIVER_VERSION=3.2.1
install:
- pip install -q cassandra-driver==$CASSANDRA_DRIVER_VERSION
- pip install -q flask
Expand Down
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Latest Version](https://img.shields.io/pypi/v/flask-cqlalchemy.svg)](https://pypi.python.org/pypi/Flask-CQLAlchemy)
[![Build Status](https://travis-ci.org/thegeorgeous/flask-cqlalchemy.svg?branch=master)](https://travis-ci.org/thegeorgeous/flask-cqlalchemy)
[![Status](https://img.shields.io/pypi/status/Flask-CQLAlchemy.svg)](https://pypi.python.org/pypi/Flask-CQLAlchemy)
[![Python Versions](https://img.shields.io/pypi/pyversions/flask-cqlalchemy.svg)](https://pypi.python.org/pypi/Flask-CQLAlchemy)
[![License](https://img.shields.io/pypi/l/Flask-CQLAlchemy.svg)](https://pypi.python.org/pypi/Flask-CQLAlchemy)
[![Code Climate](https://codeclimate.com/github/thegeorgeous/flask-cqlalchemy/badges/gpa.svg)](https://codeclimate.com/github/thegeorgeous/flask-cqlalchemy)
[![Downloads](https://img.shields.io/pypi/dm/flask-cqlalchemy.svg)](https://pypi.python.org/pypi/Flask-CQLAlchemy)
Expand All @@ -12,21 +12,23 @@ Flask-CQLAlchemy handles connections to Cassandra clusters
and gives a unified easier way to declare models and their
columns

**Now with Python 3 support**

## Installation
```
```shell
pip install flask-cqlalchemy
```

## Dependencies
As such Flask-CQLAlchemy depends only on the cassandra-driver. It is assumed
that you already have flask installed.

Flask-CQLAlchemy has been tested with versions 2.6.0, 2.7.2, 3.0.0 of
Flask-CQLAlchemy has been tested with versions 2.6.0, 2.7.2, 3.0.0 and 3.1.0 of
cassandra-driver. It is known to work with all versions >=2.5, but use it at
your own risk. All previous versions of Flask-CQLAlchemy are deprecated.

## Example
```
```python
#example_app.py
import uuid
from flask import Flask
Expand All @@ -45,7 +47,7 @@ class User(db.Model):

## Usage
Start a python shell
```
```python
>>from example_app import db, User
>>db.sync_db()
>>user1 = User.create(username='John Doe')
Expand All @@ -57,13 +59,13 @@ For a complete list of available method refer to the cqlengine
CQLAlchemy provides all the option available in the cqlengine connection.setup()
method

* CASSANDRA_HOSTS - A list of hosts
* CASSANDRA_KEYSPACE - The default keyspace to use
* CASSANDRA_CONSISTENCY - The global default ConsistencyLevel
* CASSANDRA_LAZY_CONNECT - True if should not connect until first use
* CASSANDRA_RETRY_CONNECT - True if we should retry to connect even if there was
* `CASSANDRA_HOSTS` - A list of hosts
* `CASSANDRA_KEYSPACE` - The default keyspace to use
* `CASSANDRA_CONSISTENCY` - The global default ConsistencyLevel
* `CASSANDRA_LAZY_CONNECT` - True if should not connect until first use
* `CASSANDRA_RETRY_CONNECT` - True if we should retry to connect even if there was
a connection failure initially
* CASSANDRA_SETUP_KWARGS - Pass-through keyword arguments for Cluster()
* `CASSANDRA_SETUP_KWARGS` - Pass-through keyword arguments for Cluster()

## Contributing
Found a bug? Need a feature? Open it in issues, or even better, open a PR.
Expand Down
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

setup(
name='Flask-CQLAlchemy',
version='1.0.2',
version='1.1.0',
url='http://thegeorgeous.com/flask-cqlalchemy',
license='BSD',
author='George Thomas',
Expand All @@ -39,7 +39,10 @@
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Framework :: Flask',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Topic :: Software Development :: Libraries :: Python Modules'
Expand Down

0 comments on commit a70f5ac

Please sign in to comment.