Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
persistent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
persistent
Commits
db764f69
Commit
db764f69
authored
May 14, 2012
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add explicity support for PyPy.
Drop support for Python < 2.6.
parent
e372b094
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
28 deletions
+56
-28
CHANGES.txt
CHANGES.txt
+4
-0
persistent/tests/test_timestamp.py
persistent/tests/test_timestamp.py
+5
-0
persistent/timestamp.py
persistent/timestamp.py
+2
-2
setup.py
setup.py
+44
-25
tox.ini
tox.ini
+1
-1
No files found.
CHANGES.txt
View file @
db764f69
...
...
@@ -4,6 +4,10 @@
4.0 (unreleased)
-----------------
- Added explicity support for PyPy.
- Dropped explicit support for Python < 2.6.
- Added support for continuous integration using ``tox`` and ``jenkins``.
- Added ``setup.py docs`` alias (installs ``Sphinx`` and
...
...
persistent/tests/test_timestamp.py
View file @
db764f69
...
...
@@ -53,6 +53,11 @@ class TimeStampTests(unittest.TestCase):
self
.
assertEqual
(
ts
.
second
(),
0.0
)
self
.
assertEqual
(
ts
.
timeTime
(),
DELTA_SECS
)
def
test_ctor_from_string_non_zero
(
self
):
before
=
self
.
_makeOne
(
2011
,
2
,
16
,
14
,
37
,
22.0
)
after
=
self
.
_makeOne
(
before
.
raw
())
self
.
assertEqual
(
before
.
_elements
,
after
.
_elements
)
def
test_ctor_from_elements
(
self
):
from
persistent.timestamp
import
_makeOctets
from
persistent.timestamp
import
_makeUTC
...
...
persistent/timestamp.py
View file @
db764f69
...
...
@@ -57,7 +57,7 @@ _SCONV = 60.0 / (1<<16) / (1<<16)
def
_makeRaw
(
year
,
month
,
day
,
hour
,
minute
,
second
):
a
=
(((
year
-
1900
)
*
12
+
month
-
1
)
*
31
+
day
-
1
)
a
=
(
a
*
24
+
hour
)
*
60
+
minute
b
=
int
(
second
/
_SCONV
)
b
=
round
(
second
/
_SCONV
)
return
struct
.
pack
(
'>II'
,
a
,
b
)
def
_parseRaw
(
octets
):
...
...
@@ -67,7 +67,7 @@ def _parseRaw(octets):
day
=
a
//
(
60
*
24
)
%
31
+
1
month
=
a
//
(
60
*
24
*
31
)
%
12
+
1
year
=
a
//
(
60
*
24
*
31
*
12
)
+
1900
second
=
b
*
_SCONV
second
=
round
(
b
*
_SCONV
,
6
)
#microsecond precision
return
(
year
,
month
,
day
,
hour
,
minute
,
second
)
...
...
setup.py
View file @
db764f69
...
...
@@ -15,6 +15,8 @@
__version__
=
'4.0dev'
import
os
import
platform
import
sys
from
ez_setup
import
use_setuptools
use_setuptools
()
...
...
@@ -31,6 +33,42 @@ README = (open(os.path.join(here, 'README.txt')).read()
+
'
\
n
\
n
'
+
open
(
os
.
path
.
join
(
here
,
'CHANGES.txt'
)).
read
())
py_impl
=
getattr
(
platform
,
'python_implementation'
,
lambda
:
None
)
is_pypy
=
py_impl
()
==
'PyPy'
is_jython
=
'java'
in
sys
.
platform
# Jython cannot build the C optimizations, while on PyPy they are
# anti-optimizations (the C extension compatibility layer is known-slow,
# and defeats JIT opportunities).
if
is_pypy
or
is_jython
:
ext_modules
=
headers
=
[]
else
:
ext_modules
=
[
Extension
(
name
=
'persistent.cPersistence'
,
sources
=
[
'persistent/cPersistence.c'
,
'persistent/ring.c'
,
],
depends
=
[
'persistent/cPersistence.h'
,
'persistent/ring.h'
,
'persistent/ring.c'
,
]
),
Extension
(
name
=
'persistent.cPickleCache'
,
sources
=
[
'persistent/cPickleCache.c'
,
'persistent/ring.c'
],
depends
=
[
'persistent/cPersistence.h'
,
'persistent/ring.h'
,
'persistent/ring.c'
,
]
),
Extension
(
name
=
'persistent.TimeStamp'
,
sources
=
[
'persistent/TimeStamp.c'
,
],
),
]
headers
=
[
'persistent/cPersistence.h'
,
'persistent/ring.h'
]
setup
(
name
=
'persistent'
,
version
=
__version__
,
description
=
'Translucent persistent objects'
,
...
...
@@ -39,6 +77,10 @@ setup(name='persistent',
"Development Status :: 6 - Mature"
,
"License :: OSI Approved :: Zope Public License"
,
"Programming Language :: Python"
,
'Programming Language :: Python :: 2.6'
,
'Programming Language :: Python :: 2.7'
,
"Programming Language :: Python :: Implementation :: CPython"
,
"Programming Language :: Python :: Implementation :: PyPy"
,
"Topic :: Database"
,
"Topic :: Software Development :: Libraries :: Python Modules"
,
"Operating System :: Microsoft :: Windows"
,
...
...
@@ -52,31 +94,8 @@ setup(name='persistent',
packages
=
find_packages
(),
include_package_data
=
True
,
zip_safe
=
False
,
ext_modules
=
[
Extension
(
name
=
'persistent.cPersistence'
,
sources
=
[
'persistent/cPersistence.c'
,
'persistent/ring.c'
,
],
depends
=
[
'persistent/cPersistence.h'
,
'persistent/ring.h'
,
'persistent/ring.c'
,
]
),
Extension
(
name
=
'persistent.cPickleCache'
,
sources
=
[
'persistent/cPickleCache.c'
,
'persistent/ring.c'
],
depends
=
[
'persistent/cPersistence.h'
,
'persistent/ring.h'
,
'persistent/ring.c'
,
]
),
Extension
(
name
=
'persistent.TimeStamp'
,
sources
=
[
'persistent/TimeStamp.c'
,
],
),
],
headers
=
[
'persistent/cPersistence.h'
,
'persistent/ring.h'
],
ext_modules
=
ext_modules
,
headers
=
headers
,
tests_require
=
TESTS_REQUIRE
,
extras_require
=
{
'test'
:
TESTS_REQUIRE
,
...
...
tox.ini
View file @
db764f69
...
...
@@ -3,7 +3,7 @@ envlist =
# Jython support pending 2.7 support, due 2012-07-15 or so. See:
# http://fwierzbicki.blogspot.com/2012/03/adconion-to-fund-jython-27.html
# py26,py27,py32,jython,pypy,coverage,docs
py26,py27,coverage,docs
py26,py27,
pypy,
coverage,docs
[testenv]
deps
=
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment