Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
e3aef24b
Commit
e3aef24b
authored
Mar 26, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into t
* master: tox: v↑ NEO (1.9 -> 1.12) Require Zodbtools Drop support for ZODB3
parents
36d23c25
95b012d3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
54 deletions
+12
-54
lib/tests/test_zodb.py
lib/tests/test_zodb.py
+1
-3
lib/zodb.py
lib/zodb.py
+6
-35
setup.py
setup.py
+3
-6
tox.ini
tox.ini
+2
-10
No files found.
lib/tests/test_zodb.py
View file @
e3aef24b
# Wendelin.core.bigfile | Tests for ZODB utilities
# Copyright (C) 2014-202
0
Nexedi SA and Contributors.
# Copyright (C) 2014-202
1
Nexedi SA and Contributors.
# Kirill Smelkov <kirr@nexedi.com>
#
# This program is free software: you can Use, Study, Modify and Redistribute
...
...
@@ -235,7 +235,6 @@ def test_deactivate_btree():
# verify that zconn_at gives correct answer.
@
xfail
(
zmajor
<
4
,
reason
=
"zconn_at is TODO for ZODB3"
)
@
func
def
test_zconn_at
():
stor
=
testdb
.
getZODBStorage
()
...
...
@@ -311,7 +310,6 @@ def test_zconn_at():
# verify that ZODB.Connection.onResyncCallback works
@
xfail
(
zmajor
<
4
,
reason
=
"ZODB.Connection.onResyncCallback is TODO for ZODB3"
)
@
func
def
test_zodb_onresync
():
stor
=
testdb
.
getZODBStorage
()
...
...
lib/zodb.py
View file @
e3aef24b
# Wendelin.bigfile | common ZODB-related helpers
# Copyright (C) 2014-202
0
Nexedi SA and Contributors.
# Copyright (C) 2014-202
1
Nexedi SA and Contributors.
# Kirill Smelkov <kirr@nexedi.com>
#
# This program is free software: you can Use, Study, Modify and Redistribute
...
...
@@ -25,6 +25,7 @@ from ZODB import DB
from
ZODB
import
POSException
from
ZODB.utils
import
p64
,
u64
from
persistent
import
Persistent
import
zodbtools.util
from
weakref
import
WeakSet
import
gc
from
six.moves.urllib
import
parse
as
urlparse
...
...
@@ -34,38 +35,8 @@ import pkg_resources
# open db storage by uri
def
dbstoropen
(
uri
):
# if we can - use zodbtools to open via zodburi
try
:
import
zodbtools.util
except
ImportError
:
return
_dbstoropen
(
uri
)
return
zodbtools
.
util
.
storageFromURL
(
uri
)
# simplified fallback to open a storage by URI when zodbtools/zodburi are not available.
# ( they require ZODB, instead of ZODB3, and thus we cannot use
# them together with ZODB 3.10 which we still support )
def
_dbstoropen
(
uri
):
if
uri
.
startswith
(
'neo://'
):
# XXX hacky, only 1 master supported
from
neo.client.Storage
import
Storage
name
,
master
=
uri
[
6
:].
split
(
'@'
,
1
)
# neo://db@master -> db, master
stor
=
Storage
(
master_nodes
=
master
,
name
=
name
)
elif
uri
.
startswith
(
'zeo://'
):
# XXX hacky
from
ZEO.ClientStorage
import
ClientStorage
host
,
port
=
uri
[
6
:].
split
(
':'
,
1
)
# zeo://host:port -> host, port
port
=
int
(
port
)
stor
=
ClientStorage
((
host
,
port
))
else
:
stor
=
FileStorage
(
uri
)
return
stor
# open stor/db/connection and return root obj
def
dbopen
(
uri
):
stor
=
dbstoropen
(
uri
)
...
...
@@ -197,7 +168,7 @@ def zconn_at(zconn): # -> tid
# ZODB3
else
:
raise
AssertionError
(
"zconn_at:
TODO: add support for ZODB3
"
)
raise
AssertionError
(
"zconn_at:
ZODB3 is not supported anymore
"
)
# before2at converts tid that specifies database state as "before" into tid that
...
...
@@ -268,7 +239,7 @@ ZODB.Connection.Connection.open = Connection_open
ZODB
.
Connection
.
Connection
.
_onResyncCallbacks
=
None
def
Connection_onResyncCallback
(
self
,
f
):
if
zmajor
<=
3
:
raise
AssertionError
(
"onResyncCallback:
TODO: add support for ZODB3
"
)
raise
AssertionError
(
"onResyncCallback:
ZODB3 is not supported anymore
"
)
if
self
.
_onResyncCallbacks
is
None
:
# NOTE WeakSet does not work for bound methods - they are always created
# anew for each obj.method access, and thus will go away almost immediately
...
...
@@ -317,9 +288,9 @@ elif zmajor == 4:
ZODB
.
Connection
.
Connection
.
_resetCache
=
_ZConnection__resetCache
# ZODB3
: TODO
# ZODB3
else
:
pass
# raises in onResyncCallback
raise
AssertionError
(
"ZODB3 is not supported anymore"
)
...
...
setup.py
View file @
e3aef24b
# Wendelin.core | pythonic package setup
# Copyright (C) 2014-202
0
Nexedi SA and Contributors.
# Copyright (C) 2014-202
1
Nexedi SA and Contributors.
# Kirill Smelkov <kirr@nexedi.com>
#
# This program is free software: you can Use, Study, Modify and Redistribute
...
...
@@ -365,17 +365,14 @@ setup(
install_requires
=
[
'numpy'
,
# BigArray + its children
# for ZBigFile / ZBigArray
# ( NOTE: ZODB3 3.11 just pulls in latest ZODB _4_, so this way
# specifying ZODB _3_ we allow external requirements to
# specify either to use e.g. ZODB3.10 or ZODB4 )
'ZODB >= 4'
,
# for ZBigFile / ZBigArray
'zodbtools >= 0.0.0.dev8'
,
# lib.zodb.dbstoropen + ...
#
# TODO if ZODB5: require ZODB >= 5.5.2 ?
# https://github.com/zopefoundation/ZODB/pull/298
# https://github.com/zopefoundation/ZODB/pull/291
#
# ----//---- for ZODB4 >= 4.4.6
'ZODB3 >= 3.10'
,
'pygolang >= 0.0.7'
,
# defer, sync.WaitGroup, pyx/nogil channels ...
...
...
tox.ini
View file @
e3aef24b
# wendelin.core | tox setup
[tox]
envlist
=
py27-{ZODB
3,ZODB
4,ZODB5}-{zblk0,zblk1}-{fs,zeo,neo}-{numpy115,numpy116}-{!wcfs,wcfs,wcfs:1,wcfs:2},
envlist
=
py27-{ZODB4,ZODB5}-{zblk0,zblk1}-{fs,zeo,neo}-{numpy115,numpy116}-{!wcfs,wcfs,wcfs:1,wcfs:2},
{py36,py37}-{ZODB4,ZODB5}-{zblk0,zblk1}-fs-{numpy115,numpy116}-{!wcfs,wcfs,wcfs:1,wcfs:2},
py36-{ZODB4,ZODB5}-{zblk0,zblk1}-zeo-{numpy115,numpy116}-{!wcfs,wcfs,wcfs:1,wcfs:2},
py37-ZODB5-{zblk0,zblk1}-zeo-{numpy115,numpy116-{!wcfs,wcfs,wcfs:1,wcfs:2}}
# (NOTE ZODB3 does not work on python3)
# (NOTE ZEO4 does not work with python3.7)
# (NOTE NEO does not work on python3 at all)
# (XXX ZODB5-*-neo are currently failing)
...
...
@@ -13,13 +12,6 @@ envlist = py27-{ZODB3,ZODB4,ZODB5}-{zblk0,zblk1}-{fs,zeo,neo}-{numpy115,numpy116
deps
=
.
[test]
# latest ZODB from 3 series
ZODB3:
ZODB3
>=3.10,
<3.11dev
ZODB3:
transaction
<2.0dev
# ZConfig 3.2.0 passes filename to ZEO config as unicode which eventualy breaks in FileStorage:
# https://github.com/zopefoundation/ZODB/blob/3.10.7-4-gb8d7a8567/src/ZODB/FileStorage/FileStorage.py#L1640
ZODB3:
ZConfig
<3.2.0
# latest current ZODB _4_
ZODB4:
ZODB
>=4.0,
<5.0dev
ZODB4:
ZEO
>=4.0,
<5.0dev
...
...
@@ -30,7 +22,7 @@ deps =
# ZODB/test/util depends on mock starting from ZODB 5.5
ZODB5:
mock
neo:
neoppod
>=
1.
9
neo:
neoppod
>=
1.
12
# neo.tests also imports MySQLdb unconditionally
neo:
mysqlclient
...
...
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