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

Remove most all the boilerplate required to add new trees #123

Merged
merged 4 commits into from
Mar 17, 2020

Conversation

jamadden
Copy link
Member

Follow on from #122. There were lots of .py files that have to be copied and then search-n-replaced.

This PR uses Python code to programmatically create the correct modules and test modules based on a declarative description of the data types. I'm undecided on leaving the test_*.py files around. On the one hand, they make zope-testrunner's -m filter work; on the other hand, they're more near-duplicate files.

There are four remaining custom test cases for integer overflow that I'd like to unify into the base cases.

I discovered and fixed a few bugs during the course of this, where test modules had drifted apart and didn't test everything; notably, Bucket and BTree behaved differently since 4.3.2 with regards to KeyError and TypeError in query methods.

@jamadden jamadden force-pushed the reduce-boilerplate branch 3 times, most recently from 967a6b8 to 0314b24 Compare February 27, 2020 20:27
@jamadden jamadden changed the title [WIP] Remove most all the boilerplate required to add new trees Remove most all the boilerplate required to add new trees Feb 27, 2020
@jamadden jamadden marked this pull request as ready for review February 27, 2020 21:10
@jamadden
Copy link
Member Author

I think this is ready for review. It's based on #122 so only the final commit is relevant.

This was referenced Mar 5, 2020
@jamadden
Copy link
Member Author

jamadden commented Mar 5, 2020

There are a handful of cleanups that can be enabled by this and land in a subsequent PR. Most notably, I think the nasty way we're dealing with pickling to make sure we always pickle and unpickle the best implementation can probably be cleaned up.

jamadden added 4 commits March 5, 2020 16:53
test__UUBTree.py is complete and passing on Python 3
And some other small tweaks to the documentation to make cross-references work and things generally look good.
Generate the Python modules and test modules based off a description
of the datatype.

Several tests that were previously only used for a specific classes
are now generalized and added to most trees, such as testing
non-compliant keys and testing overflow for bounded values.

Also always raise ``OverflowError`` for integer keys/values out of range.
@jamadden jamadden force-pushed the reduce-boilerplate branch from 0314b24 to 2038bcb Compare March 5, 2020 23:03
@icemac
Copy link
Member

icemac commented Mar 6, 2020

Rerun the failing TravisCI jobs as persistent == 4.6.1 fixes them.

@jamadden jamadden merged commit d49ff39 into master Mar 17, 2020
@jamadden jamadden deleted the reduce-boilerplate branch March 17, 2020 14:14
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.

2 participants