[Checkins] [zopefoundation/BTrees] 5ddd04: Support PURE_PYTHON at runtime.

GitHub noreply at github.com
Fri Mar 9 12:44:24 CET 2018


  Branch: refs/heads/master
  Home:   https://github.com/zopefoundation/BTrees
  Commit: 5ddd0442e29afe4d7ddb6f2bf5789f1b83c47af1
      https://github.com/zopefoundation/BTrees/commit/5ddd0442e29afe4d7ddb6f2bf5789f1b83c47af1
  Author: Jason Madden <jamadden at gmail.com>
  Date:   2018-03-07 (Wed, 07 Mar 2018)

  Changed paths:
    M .travis.yml
    M BTrees/IFBTree.py
    M BTrees/IIBTree.py
    M BTrees/IOBTree.py
    M BTrees/LFBTree.py
    M BTrees/LLBTree.py
    M BTrees/LOBTree.py
    M BTrees/OIBTree.py
    M BTrees/OLBTree.py
    M BTrees/OOBTree.py
    M BTrees/_compat.py
    M BTrees/fsBTree.py
    M BTrees/tests/common.py
    M BTrees/tests/testBTrees.py
    M BTrees/tests/testBTreesUnicode.py
    M CHANGES.rst
    M appveyor.yml
    M setup.py
    M tox.ini

  Log Message:
  -----------
  Support PURE_PYTHON at runtime.

Add failing tests and then fix them. Use a common function to DRY in
all the modules.

Fixes #78

Also use zope.testrunner in tox (and travis) because it allows passing
arguments to select what tests to run, see slow tests, etc.

Simplify setup.py to always build the C modules and avoid polluting
wheel caches (the same as zope.security and other projects that have
been worked on lately).

Bump the minimum 'persistent' requirement to one that actually works
in PURE_PYTHON mode (plus fix wheel metadata; otherwise we need
environment markers).

Test PURE_PYTHON in environments on Travis. Do some minor tuning to
eliminate redundant test cases and speed up test time.


  Commit: 0b663377ca96f3c54fc071bda00cd9c05ca3c9da
      https://github.com/zopefoundation/BTrees/commit/0b663377ca96f3c54fc071bda00cd9c05ca3c9da
  Author: Jason Madden <jamadden at gmail.com>
  Date:   2018-03-07 (Wed, 07 Mar 2018)

  Changed paths:
    M BTrees/_base.py

  Log Message:
  -----------
  Stop parsing the struct formats each time.

This makes the test runs in pure_python mode 15s faster.

Microbenchmarks on CPython 2.7.14:

$ python -m perf timeit -s 'from struct import pack,unpack' 'unpack("i", pack("i", 123456))'
.....................
Mean +- std dev: 365 ns +- 12 ns

$ python -m perf timeit -s 'from struct import Struct; s = Struct("i"); unpack=s.unpack; pack=s.pack' 'unpack(pack(123456))'
.....................
Mean +- std dev: 251 ns +- 9 ns

No appreciable difference on PyPy.


  Commit: 5aae589d08ae92914235bc2cd7ad9fae4f97e260
      https://github.com/zopefoundation/BTrees/commit/5aae589d08ae92914235bc2cd7ad9fae4f97e260
  Author: Jason Madden <jamadden at gmail.com>
  Date:   2018-03-08 (Thu, 08 Mar 2018)

  Changed paths:
    M BTrees/_compat.py
    M BTrees/tests/common.py
    M BTrees/tests/testBTreesUnicode.py
    M setup.py
    M tox.ini

  Log Message:
  -----------
  Cleanups from review.

Detect pip installs with 'bdist_wheel' (or manual builds for upload) and don't let the C extensions fail to build unless PURE_PYTHON is set.


  Commit: 023d96a7087fb1654c7b3f0e4a6c6f003e2b5aa1
      https://github.com/zopefoundation/BTrees/commit/023d96a7087fb1654c7b3f0e4a6c6f003e2b5aa1
  Author: Jason Madden <jason+github at nextthought.com>
  Date:   2018-03-09 (Fri, 09 Mar 2018)

  Changed paths:
    M .travis.yml
    M BTrees/IFBTree.py
    M BTrees/IIBTree.py
    M BTrees/IOBTree.py
    M BTrees/LFBTree.py
    M BTrees/LLBTree.py
    M BTrees/LOBTree.py
    M BTrees/OIBTree.py
    M BTrees/OLBTree.py
    M BTrees/OOBTree.py
    M BTrees/_base.py
    M BTrees/_compat.py
    M BTrees/fsBTree.py
    M BTrees/tests/common.py
    M BTrees/tests/testBTrees.py
    M BTrees/tests/testBTreesUnicode.py
    M CHANGES.rst
    M appveyor.yml
    M setup.py
    M tox.ini

  Log Message:
  -----------
  Merge pull request #80 from zopefoundation/issue78

Support PURE_PYTHON at runtime.


Compare: https://github.com/zopefoundation/BTrees/compare/822181c62b84...023d96a7087f


More information about the checkins mailing list