Commit e3aef24b authored by Kirill Smelkov's avatar Kirill Smelkov

Merge branch 'master' into t

* master:
  tox: v↑ NEO  (1.9 -> 1.12)
  Require Zodbtools
  Drop support for ZODB3
parents 36d23c25 95b012d3
# Wendelin.core.bigfile | Tests for ZODB utilities # Wendelin.core.bigfile | Tests for ZODB utilities
# Copyright (C) 2014-2020 Nexedi SA and Contributors. # Copyright (C) 2014-2021 Nexedi SA and Contributors.
# Kirill Smelkov <kirr@nexedi.com> # Kirill Smelkov <kirr@nexedi.com>
# #
# This program is free software: you can Use, Study, Modify and Redistribute # This program is free software: you can Use, Study, Modify and Redistribute
...@@ -235,7 +235,6 @@ def test_deactivate_btree(): ...@@ -235,7 +235,6 @@ def test_deactivate_btree():
# verify that zconn_at gives correct answer. # verify that zconn_at gives correct answer.
@xfail(zmajor < 4, reason="zconn_at is TODO for ZODB3")
@func @func
def test_zconn_at(): def test_zconn_at():
stor = testdb.getZODBStorage() stor = testdb.getZODBStorage()
...@@ -311,7 +310,6 @@ def test_zconn_at(): ...@@ -311,7 +310,6 @@ def test_zconn_at():
# verify that ZODB.Connection.onResyncCallback works # verify that ZODB.Connection.onResyncCallback works
@xfail(zmajor < 4, reason="ZODB.Connection.onResyncCallback is TODO for ZODB3")
@func @func
def test_zodb_onresync(): def test_zodb_onresync():
stor = testdb.getZODBStorage() stor = testdb.getZODBStorage()
......
# Wendelin.bigfile | common ZODB-related helpers # Wendelin.bigfile | common ZODB-related helpers
# Copyright (C) 2014-2020 Nexedi SA and Contributors. # Copyright (C) 2014-2021 Nexedi SA and Contributors.
# Kirill Smelkov <kirr@nexedi.com> # Kirill Smelkov <kirr@nexedi.com>
# #
# This program is free software: you can Use, Study, Modify and Redistribute # This program is free software: you can Use, Study, Modify and Redistribute
...@@ -25,6 +25,7 @@ from ZODB import DB ...@@ -25,6 +25,7 @@ from ZODB import DB
from ZODB import POSException from ZODB import POSException
from ZODB.utils import p64, u64 from ZODB.utils import p64, u64
from persistent import Persistent from persistent import Persistent
import zodbtools.util
from weakref import WeakSet from weakref import WeakSet
import gc import gc
from six.moves.urllib import parse as urlparse from six.moves.urllib import parse as urlparse
...@@ -34,38 +35,8 @@ import pkg_resources ...@@ -34,38 +35,8 @@ import pkg_resources
# open db storage by uri # open db storage by uri
def dbstoropen(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) 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 # open stor/db/connection and return root obj
def dbopen(uri): def dbopen(uri):
stor = dbstoropen(uri) stor = dbstoropen(uri)
...@@ -197,7 +168,7 @@ def zconn_at(zconn): # -> tid ...@@ -197,7 +168,7 @@ def zconn_at(zconn): # -> tid
# ZODB3 # ZODB3
else: 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 # before2at converts tid that specifies database state as "before" into tid that
...@@ -268,7 +239,7 @@ ZODB.Connection.Connection.open = Connection_open ...@@ -268,7 +239,7 @@ ZODB.Connection.Connection.open = Connection_open
ZODB.Connection.Connection._onResyncCallbacks = None ZODB.Connection.Connection._onResyncCallbacks = None
def Connection_onResyncCallback(self, f): def Connection_onResyncCallback(self, f):
if zmajor <= 3: if zmajor <= 3:
raise AssertionError("onResyncCallback: TODO: add support for ZODB3") raise AssertionError("onResyncCallback: ZODB3 is not supported anymore")
if self._onResyncCallbacks is None: if self._onResyncCallbacks is None:
# NOTE WeakSet does not work for bound methods - they are always created # 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 # anew for each obj.method access, and thus will go away almost immediately
...@@ -317,9 +288,9 @@ elif zmajor == 4: ...@@ -317,9 +288,9 @@ elif zmajor == 4:
ZODB.Connection.Connection._resetCache = _ZConnection__resetCache ZODB.Connection.Connection._resetCache = _ZConnection__resetCache
# ZODB3: TODO # ZODB3
else: else:
pass # raises in onResyncCallback raise AssertionError("ZODB3 is not supported anymore")
......
# Wendelin.core | pythonic package setup # Wendelin.core | pythonic package setup
# Copyright (C) 2014-2020 Nexedi SA and Contributors. # Copyright (C) 2014-2021 Nexedi SA and Contributors.
# Kirill Smelkov <kirr@nexedi.com> # Kirill Smelkov <kirr@nexedi.com>
# #
# This program is free software: you can Use, Study, Modify and Redistribute # This program is free software: you can Use, Study, Modify and Redistribute
...@@ -365,17 +365,14 @@ setup( ...@@ -365,17 +365,14 @@ setup(
install_requires = [ install_requires = [
'numpy', # BigArray + its children 'numpy', # BigArray + its children
# for ZBigFile / ZBigArray 'ZODB >= 4', # for ZBigFile / ZBigArray
# ( NOTE: ZODB3 3.11 just pulls in latest ZODB _4_, so this way 'zodbtools >= 0.0.0.dev8', # lib.zodb.dbstoropen + ...
# specifying ZODB _3_ we allow external requirements to
# specify either to use e.g. ZODB3.10 or ZODB4 )
# #
# TODO if ZODB5: require ZODB >= 5.5.2 ? # TODO if ZODB5: require ZODB >= 5.5.2 ?
# https://github.com/zopefoundation/ZODB/pull/298 # https://github.com/zopefoundation/ZODB/pull/298
# https://github.com/zopefoundation/ZODB/pull/291 # https://github.com/zopefoundation/ZODB/pull/291
# #
# ----//---- for ZODB4 >= 4.4.6 # ----//---- for ZODB4 >= 4.4.6
'ZODB3 >= 3.10',
'pygolang >= 0.0.7', # defer, sync.WaitGroup, pyx/nogil channels ... 'pygolang >= 0.0.7', # defer, sync.WaitGroup, pyx/nogil channels ...
......
# wendelin.core | tox setup # wendelin.core | tox setup
[tox] [tox]
envlist = py27-{ZODB3,ZODB4,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,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}, 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}} 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 ZEO4 does not work with python3.7)
# (NOTE NEO does not work on python3 at all) # (NOTE NEO does not work on python3 at all)
# (XXX ZODB5-*-neo are currently failing) # (XXX ZODB5-*-neo are currently failing)
...@@ -13,13 +12,6 @@ envlist = py27-{ZODB3,ZODB4,ZODB5}-{zblk0,zblk1}-{fs,zeo,neo}-{numpy115,numpy116 ...@@ -13,13 +12,6 @@ envlist = py27-{ZODB3,ZODB4,ZODB5}-{zblk0,zblk1}-{fs,zeo,neo}-{numpy115,numpy116
deps = deps =
.[test] .[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_ # latest current ZODB _4_
ZODB4: ZODB >=4.0, <5.0dev ZODB4: ZODB >=4.0, <5.0dev
ZODB4: ZEO >=4.0, <5.0dev ZODB4: ZEO >=4.0, <5.0dev
...@@ -30,7 +22,7 @@ deps = ...@@ -30,7 +22,7 @@ deps =
# ZODB/test/util depends on mock starting from ZODB 5.5 # ZODB/test/util depends on mock starting from ZODB 5.5
ZODB5: mock ZODB5: mock
neo: neoppod >= 1.9 neo: neoppod >= 1.12
# neo.tests also imports MySQLdb unconditionally # neo.tests also imports MySQLdb unconditionally
neo: mysqlclient neo: mysqlclient
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment