Skip to content

Commit

Permalink
Require at least Python 2.6
Browse files Browse the repository at this point in the history
Remove some backwards compatibility code and update docs
  • Loading branch information
hannosch committed Nov 9, 2012
1 parent 0f5b020 commit cb415e5
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 26 deletions.
1 change: 0 additions & 1 deletion .travis.yml
@@ -1,6 +1,5 @@
language: python
python:
- "2.5"
- "2.6"
- "2.7"

Expand Down
7 changes: 7 additions & 0 deletions CHANGES
@@ -1,3 +1,10 @@
Changes in Version 1.8.0

This release requires either Python 2.6 or 2.7. Python 2.4 and 2.5
are no longer supported. There are no concrete plans for Python 3
compatibility yet.


Changes in Version 1.7.2

This release fixes a minor bug and upgrades the bundled Cassandra
Expand Down
2 changes: 1 addition & 1 deletion doc/assorted/pycassa_shell.rst
Expand Up @@ -7,7 +7,7 @@ exploring Cassandra, especially for those who are just beginning.

Requirements
------------
Python 2.4 or later is required.
Python 2.6 or later is required.

Make sure you have **pycassa** installed as shown in :ref:`installing`.

Expand Down
7 changes: 7 additions & 0 deletions doc/changelog.rst
@@ -1,6 +1,13 @@
Changelog
=========

Changes in Version 1.8.0
------------------------
This release requires either Python 2.6 or 2.7. Python 2.4 and 2.5
are no longer supported. There are no concrete plans for Python 3
compatibility yet.


Changes in Version 1.7.2
------------------------
This release fixes a minor bug and upgrades the bundled Cassandra
Expand Down
4 changes: 4 additions & 0 deletions doc/installation.rst
Expand Up @@ -3,6 +3,10 @@
Installing
==========

Requirements
------------
You need to have either Python 2.6 or 2.7 installed.

Installing from PyPi
--------------------
If you have :file:`pip` installed, you can simply do:
Expand Down
2 changes: 1 addition & 1 deletion pycassa/batch.py
Expand Up @@ -45,7 +45,7 @@
.. note:: If a single operation in a batch fails, the whole batch fails.
In Python >= 2.5, mutators can be used as context managers, where an implicit
In addition mutators can be used as context managers, where an implicit
:meth:`send` will be called upon exit.
.. code-block:: python
Expand Down
16 changes: 3 additions & 13 deletions pycassa/marshal.py
Expand Up @@ -13,19 +13,9 @@

_number_types = frozenset((int, long, float))

if hasattr(struct, 'Struct'): # new in Python 2.5
def make_packer(fmt_string):
return struct.Struct(fmt_string)
else:
def make_packer(fmt_string):
class Struct(object):
def pack(self, v):
return struct.pack(fmt_string, v)

def unpack(self, v):
return struct.unpack(fmt_string, v)

return Struct()

def make_packer(fmt_string):
return struct.Struct(fmt_string)

_bool_packer = make_packer('>B')
_float_packer = make_packer('>f')
Expand Down
16 changes: 6 additions & 10 deletions setup.py
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
#

import os, sys
import os

try:
import subprocess
Expand All @@ -23,7 +23,7 @@

from distutils.cmd import Command

__version__ = "1.7.2"
__version__ = "1.8.0"

long_description = """pycassa is a python client library for Apache Cassandra with the following features:
Expand All @@ -34,11 +34,6 @@
5. A method to map an existing class to a Cassandra column family
"""

if sys.version_info < (2, 6):
install_requires = ['thrift < 0.9.0']
else:
install_requires = ['thrift']


class rpm(Command):

Expand Down Expand Up @@ -128,7 +123,7 @@ def run(self):
packages = ['pycassa',
'pycassa.cassandra',
'pycassa.logging'],
install_requires = install_requires,
install_requires = ['thrift'],
py_modules=['ez_setup'],
scripts=['pycassaShell'],
cmdclass={"doc": doc, "rpm": rpm},
Expand All @@ -138,10 +133,11 @@ def run(self):
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.4',
'Programming Language :: Python :: 2.5',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 2 :: Only',
'Topic :: Software Development :: Libraries :: Python Modules'
]
)

0 comments on commit cb415e5

Please sign in to comment.