Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuring for c-code #178

Merged
merged 6 commits into from
Mar 9, 2022
Merged

Configuring for c-code #178

merged 6 commits into from
Mar 9, 2022

Conversation

icemac
Copy link
Member

@icemac icemac commented Mar 7, 2022

Open issues:

  • locally Sphinx tests for pure versions fail (see below)

Fixes #176

@icemac
Copy link
Member Author

icemac commented Mar 7, 2022

Local problems using the pure versions:

py37-pure develop-inst-noop: /.../BTrees
py37-pure installed: alabaster==0.7.12,Babel==2.9.1,-e git+https://github.com/zopefoundation/BTrees@e9d3bfc301c24ebe2ef8c6818926de41da342f47#egg=BTrees,certifi==2021.10.8,cffi==1.15.0,charset-normalizer==2.0.12,docutils==0.17.1,idna==3.3,imagesize==1.3.0,importlib-metadata==4.11.2,Jinja2==3.0.3,MarkupSafe==2.1.0,packaging==21.3,persistent==4.7.0,pycparser==2.21,Pygments==2.11.2,pyparsing==3.0.7,pytz==2021.3,repoze.sphinx.autointerface==0.8,requests==2.27.1,six==1.16.0,snowballstemmer==2.2.0,Sphinx==4.4.0,sphinx-rtd-theme==1.0.0,sphinxcontrib-applehelp==1.0.2,sphinxcontrib-devhelp==1.0.2,sphinxcontrib-htmlhelp==2.0.0,sphinxcontrib-jsmath==1.0.1,sphinxcontrib-qthelp==1.0.3,sphinxcontrib-serializinghtml==1.1.5,transaction==3.0.1,typing_extensions==4.1.1,urllib3==1.26.8,zipp==3.7.0,zope.exceptions==4.5,zope.interface==5.4.0,zope.testrunner==5.4.0
py37-pure run-test-pre: PYTHONHASHSEED='3746144695'
py37-pure run-test: commands[0] | zope-testrunner --test-path=src -vc
Running tests at level 1
Running zope.testrunner.layer.UnitTests tests:
  Set up zope.testrunner.layer.UnitTests in 0.000 seconds.
  Running:
.................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
  Ran 7169 tests with 0 failures, 0 errors, 532 skipped in 16 minutes 16.347 seconds.
Tearing down left over layers:
  Tear down zope.testrunner.layer.UnitTests in 0.000 seconds.
py37-pure run-test: commands[1] | sphinx-build -b doctest -d /.../BTrees/.tox/py37-pure/.cache/doctrees docs /.../BTrees/.tox/py37-pure/.cache/doctest
Sphinx v4.4.0 in Verwendung
loading pickled environment... erledigt
building [mo]: targets for 0 po files that are out of date
building [doctest]: targets for 5 source files that are out of date
updating environment: 0 added, 0 changed, 0 removed
looking for now-outdated files... none found
running tests...

Document: overview
------------------
Object classImplements(list, IMutableSequence, IIterable) has different legacy and C3 MROs:
  Legacy RO (len=11)                                    C3 RO (len=11; inconsistent=no)
  ==========================================================================================================
    classImplements(list, IMutableSequence, IIterable)    classImplements(list, IMutableSequence, IIterable)
    zope.interface.common.collections.IMutableSequence    zope.interface.common.collections.IMutableSequence
    zope.interface.common.collections.ISequence           zope.interface.common.collections.ISequence
    zope.interface.common.collections.IReversible         zope.interface.common.collections.IReversible
    zope.interface.common.collections.ICollection         zope.interface.common.collections.ICollection
    zope.interface.common.collections.ISized              zope.interface.common.collections.ISized
                                                        + zope.interface.common.collections.IIterable
    zope.interface.common.collections.IContainer          zope.interface.common.collections.IContainer
  - zope.interface.common.collections.IIterable
    zope.interface.common.ABCInterface                    zope.interface.common.ABCInterface
                                                        + classImplements(object)
    zope.interface.Interface                              zope.interface.Interface
  - classImplements(object)
**********************************************************************
File "overview.rst", line 141, in default
Failed example:
    s
Expected:
    <OOBTreeItems object at ...>
Got:
    <BTrees._base._TreeItems object at 0x10477d450>
**********************************************************************
File "overview.rst", line 169, in default
Failed example:
    t.has_key(4)  # returns a true value
Expected:
    True
Got:
    2
**********************************************************************
File "overview.rst", line 261, in default
Failed example:
    s
Expected:
    OOSet([[1], [5], [3]])
Got:
    BTrees.OOBTree.OOSet([[1], [5], [3]])
**********************************************************************
1 items had failures:
   3 of  37 in default
37 tests in 1 items.
34 passed and 3 failed.
***Test Failed*** 3 failures.

Doctest summary
===============
   37 tests
    3 failures in tests
    0 failures in setup code
    0 failures in cleanup code
build mit Problemen beendet.
ERROR: InvocationError for command /.../BTrees/.tox/py37-pure/bin/sphinx-build -b doctest -d .tox/py37-pure/.cache/doctrees docs .tox/py37-pure/.cache/doctest (exited with code 1)

The inconsistencies between Legacy RO and C3 RO also occur for the C versions.

@d-maurer
Copy link
Contributor

d-maurer commented Mar 7, 2022

Local problems using the pure versions:

There are still some minor differences between the C and Python implementations as demonstrated by the failing tests. They have likely not yet been detected because this doctest was not run for the Python implementation.

Expected:
OOSet([[1], [5], [3]])
Got:
BTrees.OOBTree.OOSet([[1], [5], [3]])

Apparently, the str of the "C" implementation suppresses the module path component. We could change the test to get independent of this.

Expected:
<OOBTreeItems object at ...>
Got:
<BTrees._base._TreeItems object at 0x10477d450>

The Python implementation tries to pretend the same class names as the "C" implementation -- for the main classes. The _TreeItems class, however, is considered an auxiliary class and lacks the "pretending class name" logic. Again, we could change the test to not depend on such details.

Failed example:
t.has_key(4) # returns a true value
Expected:
True
Got:
2

This likely comes from BTrees._base:line 994ff:

    def has_key(self, key):
        index = self._search(key)
        if index < 0:
            return False
        r = self._data[index].child.has_key(key)
        return r and r + 1

We could either change the test or introduce bool(...) into the return value computation.

Michael Howitz added 3 commits March 7, 2022 11:22
Run the tests with ZODB on a modern Python version.
@icemac
Copy link
Member Author

icemac commented Mar 8, 2022

@d-maurer I implemented your suggestions. Could you please review the PR?

@icemac
Copy link
Member Author

icemac commented Mar 8, 2022

The manylinux builds fail with:

+ yum -y install libffi-devel
Loaded plugins: ovl
Setting up Install Process
https://vault.centos.org/centos/6/os/i386/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 403 Forbidden"
Trying other mirror.
To address this issue please refer to the below wiki article

https://wiki.centos.org/yum-errors

If above article doesn't help to resolve this issue please use [https://bugs.centos.org/.](https://bugs.centos.org/)

Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again

The suggestion to clean the cache did not help. I've seen this problem for other packages, too. Restarting the build did help mostly there but not (yet) for the BTrees repository.
Does anyone have an idea?

icemac pushed a commit to zopefoundation/meta that referenced this pull request Mar 8, 2022
src/BTrees/_base.py Outdated Show resolved Hide resolved
@icemac
Copy link
Member Author

icemac commented Mar 9, 2022

Interestingly GHA ran successfully for the last commit, so I am going to merge and release.

@d-maurer Thank you for reviewing this PR. 😃

@icemac icemac merged commit 4721796 into master Mar 9, 2022
@icemac icemac deleted the config-with-c-code branch March 9, 2022 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert to meta/config
2 participants