Skip to content

Commit

Permalink
Add Python 3 compatibility, closes #2.
Browse files Browse the repository at this point in the history
  • Loading branch information
hannosch committed Sep 24, 2016
1 parent 1463cea commit 7d49cde
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 16 deletions.
9 changes: 4 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ language: python
sudo: false
python:
- "2.7"
# - "3.3"
# - "3.4"
# - "3.5"
# - "pypy"
# - "pypy3"
- "3.3"
- "3.4"
- "3.5"
- "pypy"
install:
- python bootstrap.py
- bin/buildout
Expand Down
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Changelog
3.0 (unreleased)
----------------

- #2: Add Python 3 compatibility.

- #1: Resolve meta class conflict for PersistentMapping.

- Update ExtensionClass and persistent headers and minimum versions.
Expand Down
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@
"Programming Language :: Python",
"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",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: Implementation :: CPython",
# "Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python :: Implementation :: PyPy",
],
ext_modules=ext_modules,
install_requires=[
Expand Down
2 changes: 1 addition & 1 deletion src/Persistence/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __setstate__(self, state):
del state['_container']
self.__dict__.update(state)

else:
else: # pragma: no cover

class PersistentMapping(six.with_metaclass(
_Meta, Persistent, _BasePersistentMapping)):
Expand Down
7 changes: 5 additions & 2 deletions src/Persistence/tests/test_persistent.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,18 @@
##############################################################################

import os
from struct import pack
import pickle
import platform
from struct import pack
import time
import unittest

from Persistence import Persistent
from persistent.picklecache import PickleCache
from persistent.TimeStamp import TimeStamp

py_impl = getattr(platform, 'python_implementation', lambda: None)
IS_PYPY = py_impl() == 'PyPy'
IS_PURE = 'PURE_PYTHON' in os.environ


Expand Down Expand Up @@ -110,7 +113,7 @@ def test_oid_jar_attrs(self):

self.jar.add(obj)

if not IS_PURE:
if not (IS_PURE or IS_PYPY):
# Can change oid of cache object since persistent 4.0.8
del obj._p_oid
obj._p_oid = 12
Expand Down
4 changes: 1 addition & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
[tox]
envlist =
py27,py27-pure,coverage

# py33,py34,py35,pypy,pypy3
py27,py27-pure,py33,py34,py35,pypy,coverage

[testenv]
install_command = pip install --no-cache-dir {opts} {packages}
Expand Down

0 comments on commit 7d49cde

Please sign in to comment.