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
7ca05c0d
Commit
7ca05c0d
authored
Jul 31, 2018
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Build CFFI modules the modern way. Fixes #75 and fixes #43
parent
57a4e83f
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
47 additions
and
15 deletions
+47
-15
.manylinux-install.sh
.manylinux-install.sh
+1
-0
.travis.yml
.travis.yml
+1
-1
CHANGES.rst
CHANGES.rst
+7
-0
appveyor.yml
appveyor.yml
+1
-1
persistent/_ring_build.py
persistent/_ring_build.py
+31
-0
persistent/ring.py
persistent/ring.py
+3
-12
persistent/tests/test_picklecache.py
persistent/tests/test_picklecache.py
+1
-1
setup.py
setup.py
+1
-0
tox.ini
tox.ini
+1
-0
No files found.
.manylinux-install.sh
View file @
7ca05c0d
...
...
@@ -9,6 +9,7 @@ for PYBIN in /opt/python/*/bin; do
[[
"
${
PYBIN
}
"
==
*
"cp35"
*
]]
||
\
[[
"
${
PYBIN
}
"
==
*
"cp36"
*
]]
||
\
[[
"
${
PYBIN
}
"
==
*
"cp37"
*
]]
;
then
"
${
PYBIN
}
/pip"
install
-U
pip setuptools wheel cffi
"
${
PYBIN
}
/pip"
install
-e
/io/
"
${
PYBIN
}
/pip"
wheel /io/
-w
wheelhouse/
rm
-rf
/io/build /io/
*
.egg-info
...
...
.travis.yml
View file @
7ca05c0d
...
...
@@ -56,7 +56,7 @@ before_install:
-
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then source terryfy/travis_tools.sh; fi
-
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then get_python_environment $TERRYFY_PYTHON venv; fi
install
:
-
pip install -U pip setuptools
-
pip install -U pip setuptools
cffi wheel
-
pip install -U -e .[test]
script
:
-
python --version
...
...
CHANGES.rst
View file @
7ca05c0d
...
...
@@ -6,6 +6,13 @@
- Add support for Python 3.7 and drop support for Python 3.3.
- Build the CFFI modules (used on PyPy or when PURE_PYTHON is set) at
installation or wheel building time when CFFI is available. This
replaces the deprecated way of building them at import time. If
binary wheels are distributed, it eliminates the need to have a
functioning C compiler to use PyPy. See `issue 75
<https://github.com/zopefoundation/persistent/issues/75>`_.
4.3.0 (2018-07-30)
------------------
...
...
appveyor.yml
View file @
7ca05c0d
...
...
@@ -18,7 +18,7 @@ environment:
install
:
-
"
SET
PATH=C:
\\
Python%PYTHON%;c:
\\
Python%PYTHON%
\\
scripts;%PATH%"
-
echo "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 > "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\vcvars64.bat"
-
python -m pip install -U pip setuptools wheel
-
python -m pip install -U pip setuptools wheel
cffi
-
pip install -e .[test]
build_script
:
...
...
persistent/_ring_build.py
0 → 100644
View file @
7ca05c0d
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2018 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
from
__future__
import
absolute_import
,
print_function
,
division
import
os
from
cffi
import
FFI
this_dir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
ffi
=
FFI
()
with
open
(
os
.
path
.
join
(
this_dir
,
'ring.h'
))
as
f
:
ffi
.
cdef
(
f
.
read
())
ffi
.
set_source
(
'persistent._ring'
,
'#include "ring.c"'
,
include_dirs
=
[
this_dir
])
if
__name__
==
'__main__'
:
ffi
.
compile
()
persistent/ring.py
View file @
7ca05c0d
...
...
@@ -144,21 +144,12 @@ class _DequeRing(object):
try
:
from
cffi
import
FFI
from
persistent
import
_ring
except
ImportError
:
# pragma: no cover
_CFFIRing
=
None
else
:
import
os
this_dir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
ffi
=
FFI
()
with
open
(
os
.
path
.
join
(
this_dir
,
'ring.h'
))
as
f
:
ffi
.
cdef
(
f
.
read
())
_FFI_RING
=
ffi
.
verify
(
"""
#include "ring.c"
"""
,
include_dirs
=
[
this_dir
])
ffi
=
_ring
.
ffi
_FFI_RING
=
_ring
.
lib
_OGA
=
object
.
__getattribute__
_OSA
=
object
.
__setattr__
...
...
persistent/tests/test_picklecache.py
View file @
7ca05c0d
...
...
@@ -1055,7 +1055,7 @@ class PickleCacheTests(unittest.TestCase):
if
_is_pypy
:
self
.
assertIs
(
ring
.
Ring
,
ring
.
_CFFIRing
)
elif
ring
.
_CFFIRing
is
not
None
:
elif
ring
.
_CFFIRing
is
not
None
or
os
.
environ
.
get
(
'USING_CFFI'
)
:
self
.
assertIs
(
ring
.
Ring
,
ring
.
_CFFIRing
)
else
:
self
.
assertIs
(
ring
.
Ring
,
ring
.
_DequeRing
)
...
...
setup.py
View file @
7ca05c0d
...
...
@@ -110,6 +110,7 @@ setup(name='persistent',
include_package_data
=
True
,
zip_safe
=
False
,
ext_modules
=
ext_modules
,
cffi_modules
=
[
'persistent/_ring_build.py:ffi'
],
headers
=
headers
,
extras_require
=
{
'test'
:
[
...
...
tox.ini
View file @
7ca05c0d
...
...
@@ -7,6 +7,7 @@ envlist =
[testenv]
deps
=
cffi
.
[test]
commands
=
zope-testrunner
--test-path
=
.
...
...
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