Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support for EOL Python 2.6 #188

Merged
merged 3 commits into from
Jan 28, 2018
Merged
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
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ python:
- "3.4"
- "3.3"
- "2.7"
- "2.6"
matrix:
allow_failures:
- python: nightly
Expand Down
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ TinyDB is:
e.g. `PyMongo <http://api.mongodb.org/python/current/>`_) nor any dependencies
from PyPI.

- **works on Python 2.6 + 2.7 and 3.3 – 3.6 and PyPy:** TinyDB works on all
modern versions of Python and PyPy.
- **works on Python 2.7 and 3.3 – 3.6 and PyPy:** TinyDB works on all modern
versions of Python and PyPy.

- **powerfully extensible:** You can easily extend TinyDB by writing new
storages or modify the behaviour of storages with Middlewares.
Expand Down Expand Up @@ -93,7 +93,7 @@ Using Middlewares
Supported Python Versions
*************************

TinyDB has been tested with Python 2.6, 2.7, 3.3 - 3.5 and PyPy.
TinyDB has been tested with Python 2.7, 3.3 - 3.6 and PyPy.


Extensions
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# coding=utf-8
from distutils.util import convert_path
from setuptools import setup, find_packages
from codecs import open
import os
Expand Down Expand Up @@ -36,12 +35,14 @@ def read(fname):
"Topic :: Database",
"Topic :: Database :: Database Engines/Servers",
"Topic :: Utilities",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Operating System :: OS Independent"
],
Expand Down
2 changes: 1 addition & 1 deletion tests/test_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def test_tables_list(db):
db.table('table1')
db.table('table2')

assert db.tables() == set(['_default', 'table1', 'table2'])
assert db.tables() == {'_default', 'table1', 'table2'}


def test_one_table(db):
Expand Down
14 changes: 7 additions & 7 deletions tests/test_tinydb.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ def test_insert_string(tmpdir):
_db.insert([1, 2, 3]) # Fails

with pytest.raises(ValueError):
_db.insert(set(['bark'])) # Fails
_db.insert({'bark'}) # Fails

assert data == _db.all()

Expand All @@ -421,7 +421,7 @@ def test_insert_invalid_dict(tmpdir):
_db.insert_multiple(data)

with pytest.raises(TypeError):
_db.insert({'int': set(['bark'])}) # Fails
_db.insert({'int': {'bark'}}) # Fails

assert data == _db.all()

Expand All @@ -445,14 +445,14 @@ def test_non_default_table():
assert [TinyDB.DEFAULT_TABLE] == list(db.tables())

db = TinyDB(storage=MemoryStorage, default_table='non-default')
assert set(['non-default']) == db.tables()
assert {'non-default'} == db.tables()

db.purge_tables()
default_table = TinyDB.DEFAULT_TABLE

TinyDB.DEFAULT_TABLE = 'non-default'
db = TinyDB(storage=MemoryStorage)
assert set(['non-default']) == db.tables()
assert {'non-default'} == db.tables()

TinyDB.DEFAULT_TABLE = default_table

Expand All @@ -467,14 +467,14 @@ def test_purge_table():
table_name = 'some-other-table'
db = TinyDB(storage=MemoryStorage)
db.table(table_name)
assert set([TinyDB.DEFAULT_TABLE, table_name]) == db.tables()
assert {TinyDB.DEFAULT_TABLE, table_name} == db.tables()

db.purge_table(table_name)
assert set([TinyDB.DEFAULT_TABLE]) == db.tables()
assert {TinyDB.DEFAULT_TABLE} == db.tables()
assert table_name not in db._table_cache

db.purge_table('non-existent-table-name')
assert set([TinyDB.DEFAULT_TABLE]) == db.tables()
assert {TinyDB.DEFAULT_TABLE} == db.tables()


def test_empty_write(tmpdir):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class MyWarning(Warning):


def test_freeze():
frozen = freeze([0, 1, 2, {'a': [1, 2, 3]}, set([1, 2])])
frozen = freeze([0, 1, 2, {'a': [1, 2, 3]}, {1, 2}])
assert isinstance(frozen, tuple)
assert isinstance(frozen[3], FrozenDict)
assert isinstance(frozen[3]['a'], tuple)
Expand Down
2 changes: 1 addition & 1 deletion tinydb/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __hash__(self):
return hash(self.hashval)

def __repr__(self):
return 'QueryImpl{0}'.format(self.hashval)
return 'QueryImpl{}'.format(self.hashval)

def __eq__(self, other):
return self.hashval == other.hashval
Expand Down