Skip to content

test/gen_testdata: Require ZODB ≥ 5 explicitly

Kirill Smelkov requested to merge kirr/zodbtools:y/testdata-z5 into master

Zodbtools supports ZODB ≥ 4 so far (see e.g. c59a54ca "Drop support for ZODB3"). However running gen_testdata.py works only with ZODB5 and later as it currently fails on ZODB4:

(z4-dev) kirr@deca:~/src/wendelin/z/zodbtools/zodbtools/test$ python gen_testdata.py
Traceback (most recent call last):
  File "gen_testdata.py", line 70, in <module>
    from ZODB.Connection import TransactionMetaData
ImportError: cannot import name TransactionMetaData

We discussed this with Jérome and we think it is ok to require ZODB ≥ 5 for testdata generation because even with ZODB5 we generate all kinds of ZODB test data we care about and commit them to git:

py2: ZODB 4 and ZODB5 < 5.3     (pickle protocol 1)
py2: ZODB 5.3                   (pickle protocol 2)
py2: ZODB ≥ 5.4                 (pickle protocol 3)
py3: ZODB4 and ZODB5            (pickle protocol 3)

-> Add explicit check that ZODB is 5 or later when running the script to avoid any potential confusion with ImportError: cannot import name TransactionMetaData.

/discussed-at https://lab.nexedi.com/nexedi/zodbtools/-/merge_requests/21
/cc @jerome

Merge request reports